import Control.Monad

iterate_cards :: [String]
iterate_cards = [unwords [suit, show num] | suit <- ["S", "H", "C", "D"], num <- [1..13]]

main :: IO ()
main = do
  n <- readLn
  cards <- replicateM n getLine
  mapM_ putStrLn [card | card <- iterate_cards, not $ elem card cards]