import Control.Monad
allcards = [s++" "++show n|s<-["S","H","C","D"], n<-[1..13]]
main = do
  n <- readLn :: IO Int
  cards <- return . lines =<< getContents
  forM_ [0..51] $ \i -> do
    if not $ elem (allcards !! i) cards then putStrLn $ allcards!!i
    else return ()
