solve :: Int -> Int solve 1 = 7 solve 2 = 8 solve 3 = 9 solve 4 = 4 solve 5 = 5 solve 6 = 6 solve 7 = 1 solve 8 = 2 solve 9 = 3 solve 10 = 0 solve _ = -1 main :: IO () main = do n <- readLn :: IO Int print $ solve n