import Data.List

solve cards = [ s ++ " " ++ show r | s <- ["S","H","C","D"], r <- [1..13], (s,r) `notElem` cards]

main = getContents >>= mapM_ putStrLn . solve . sort . map ((\[x,y] -> (x,read y :: Int)).  words) . tail . lines