table :: [Int] table = [7, 8, 9, 4, 5, 6, 1, 2, 3, 0] main = do n <- readLn print $ table !! (n - 1)