import Control.Monad

main :: IO ()
main = do
    n     <- readLn
    lines <- replicateM n getLine
    let cards = map ((\[s, r] -> (s, r)) . words) lines
    mapM_ (\t -> putStrLn (fst t ++ " " ++ snd t)) $ filter (\t -> elem t cards == False) [(s, show r) | s <- ["S", "H", "C", "D"], r <- [1 .. 13]]