conv :: Integer -> String conv 0 = "" conv n = (show (n `mod` 7)) ++ conv (n `div` 7) main = do n <- readLn :: IO Integer putStrLn $ conv n