import Control.Applicative
import qualified Control.Monad as Monad

type Card = (String, Int)

main = do
    n <- read <$> getLine
    hc <- map (toCard . words) <$> Monad.replicateM n getLine
    mapM_ (putStrLn . fromCard) $ missingCards hc

toCard :: [String] -> Card
toCard [p,r] = (p, read r)

fromCard :: Card -> String
fromCard (p,r) = p ++ " " ++ (show r)

missingCards :: [Card] -> [Card]
missingCards hc = [ (p,r) | p <- ["S","H","C","D"], r <- [1..13], not $ (p,r) `elem` hc ]