PROGRAM zeller
  IMPLICIT NONE

  INTEGER :: d,m,y, a,b,c,j,k, h

  PRINT *, "Dwse hmera, mhna kai etos"
  READ *, d,m,y
  
  IF ((m==1) .OR. (m==2)) THEN
     m = m + 12
     y = y - 1
  END IF

  a = (13*(m+1))/5
  j = y/100
  k = MOD(y,100)

  b = j/4
  c = k/4

  h = a+b+c+d+k+5*j

  SELECT CASE (MOD(h,7))
  CASE (0)
     PRINT *, "Savvato"
  CASE(1)
     PRINT *, "Kyriaki"
  CASE(2)
     PRINT *, "Deytera"
  CASE(3)
     PRINT *, "Trith"
  CASE(4)
     PRINT *, "Tetarth"
  CASE(5)
     PRINT *, "Pempth"
  CASE(6)
     PRINT *, "Paraskeyh"
  END SELECT

END PROGRAM zeller
