PROGRAM dig
  IMPLICIT NONE

  INTEGER :: n, a(10), k

  DO
     PRINT *, "Dose thetiko"
     READ *, n
     IF (n >= 0) EXIT     
  END DO

  
  DO k = 1,SIZE(a)
     a(k) = MOD(n,10)
     n = n / 10
  END DO

  DO k = SIZE(a),1,-1
     PRINT *, a(k)
  END DO
  
END PROGRAM dig
