import Control.Monad

showp s r = (s : ' ' : show r)

suit = "SHCD"
rank = [1..13]

main = do
    n <- readLn
    cards <- replicateM n getLine
    mapM_ putStrLn $ flip filter [showp s r | s <- suit, r <- rank] $ not . flip elem cards