main :: IO () main = getLine >>= putStrLn . reverse . solve . read solve :: Int -> [Char] solve n | n <= 25 = [['A'..'Z'] !! n] | otherwise = ['A'..'Z'] !! (n `mod` 26) : solve (n `div` 26 - 1)