main = getLine >>= putStrLn . map (\(n,c) -> (head . drop n . dropWhile (/=c)) (cycle ['Z','Y'..'A'])) . zip (cycle [1..26])