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