{-# LANGUAGE BangPatterns #-}

module Main where

import Data.Char
import Data.List
import Control.Monad
import Control.Monad.ST
import Data.Array.ST
import Data.Array.Unboxed
import Control.Applicative
import Text.Printf

readInt :: IO Int
readInt = read <$> (input `seq` input)
    where input = do
            !c <- getChar
            if isDigit c || c == '-'
                then (c :) <$> input
                else return []

prints :: Show a => [a] -> IO ()
prints as = putStrLn $ concat $ intersperse " " $ map show as


data Mark = S | H | C | D deriving (Eq, Ord, Show, Read, Enum)

main = do
    n <- readInt
    mns <- replicateM n getPair
    let res = go mns
    forM_ [0..3] $ \m -> do
        let mark = toEnum m :: Mark
        forM_ [1..13] $ \n -> do
            when (not $ res ! (m,n)) $ putStrLn (printf "%s %d" (show mark) n)

getPair = do
    m <- getChar
    _ <- getChar
    n <- readInt
    return (fromEnum $ (read [m] :: Mark), n)

go :: [(Int, Int)] -> UArray (Int, Int) Bool
go mns = runSTUArray $ do
    cards <- newArray ((0, 1), (3, 13)) False
    forM_ mns $ \(m,n) -> writeArray cards (m,n) True
    return cards

