import Control.Monad rconv :: Integral a => a -> Bool -> [a] rconv n f | f && n < 26 = [n] | not f && n < 27 = [pred n] | f = rconv (n `div` 26) False ++ [n `mod` 26] | not f = rconv (n `div` 27) False ++ [n `mod` 27] cconv :: Integral a => a -> Char -> Char cconv 0 c = c cconv n c = cconv (pred n) (succ c) solve :: Integral a => a -> [Char] solve n = [cconv t 'A' | t <- rconv n True] main = do n <- readLn putStrLn $ solve n