import Control.Applicative

type Card = (String, Int)

type Problem = [Card]

type Result = [Card]

solve :: Problem -> Result

solve xs
    = [x | x <- s ++ h ++ c ++ d, not $ elem x xs] where
        s = [("S", rank) | rank <- [1..13]]
        h = [("H", rank) | rank <- [1..13]]
        c = [("C", rank) | rank <- [1..13]]
        d = [("D", rank) | rank <- [1..13]]

input :: IO Problem

input
    = do
        n <- read <$> getLine
        xs <- inputCards n []
        return xs
        
inputCards :: Int -> Problem -> IO Problem

inputCards 0 xs
    = return xs
    
inputCards n xs
    = do
        [kind, rank] <- words <$> getLine
        inputCards (n - 1) $ (kind, read rank) : xs
    
output :: Result -> IO ()

output []
    = return ()
    
output xs
    = putStrLn $ init $ concat [kind ++ " " ++ show rank ++ "\n" | (kind, rank) <- xs]
    
main :: IO ()

main = output =<< solve <$> input