import Control.Monad
import Data.List

type Trump = (Char, Int)

toTrump :: String -> Trump
toTrump l = let (c:n:_) = words l
                charC = head c
            in (charC, read n)

allTrump :: [Trump]
allTrump = let c = concat . map (\c -> take 13 . repeat $ c) $ ['S', 'H', 'C', 'D']
               n = concat . take 4 . repeat $ [1..13]
           in zip c n

trumpShow :: (Trump) -> String
trumpShow (c, n) = c : " " ++  show n

main = do
  n <- getLine
  l <- replicateM (read n) getLine
  let tlist = map toTrump $ l
      solvTrump = filter (\x -> not $ x `elem` tlist) allTrump
  mapM_ (putStrLn . trumpShow) $ solvTrump