import Control.Monad (replicateM)
import Data.Functor ((<$>))
import Data.List ((\\))

readCard :: String -> (String, Int)
readCard s = let [suit, rank] = words s
            in (suit, read rank)

showCard :: (String, Int) -> String
showCard (suit, rank) = suit ++ " " ++ show rank

main :: IO ()
main = do
    n <- read <$> getLine
    cards <- replicateM n (readCard <$> getLine)
    let all_cards = [(suit, rank) | suit <- ["S", "H", "C", "D"], rank <- [1 .. 13]]
    putStr . unlines . map showCard $ all_cards \\ cards

