main :: IO ()
main = do
  ls <- getContents
  let ls' = map (read :: String -> Int) (lines ls)
      ansL = solve ls'
  mapM_ putStrLn ansL
solve :: [Int] -> [String]
solve [] = []
solve (i:is) = ("3C" ++ (format (i `mod` 39))):(solve is)

format :: Int -> String
format 0 = "39"
format i = (replicate (2 - length s) '0') ++ s
  where s = show i