import Data.Maybe
main = do
    n <- readLn
    let table = zip ['A'..'Z'] (drop n ['A'..'Z'] ++ take n ['A'..'Z'])
    solve table <$> getLine >>= putStrLn

solve table (c:s) = (fromMaybe '_' $ lookup c table) : solve table s
solve _ _ = []