import           Control.Applicative
import           Control.Monad
import           Data.List           ((\\))

data Suit
    = Spade
    | Heart
    | Club
    | Dia
    deriving (Eq, Ord)

instance Show Suit where
    show Spade = "S"
    show Heart = "H"
    show Club  = "C"
    show Dia   = "D"

instance Read Suit where
    readsPrec _ "S" = [(Spade, "")]
    readsPrec _ "H" = [(Heart, "")]
    readsPrec _ "C" = [(Club, "")]
    readsPrec _ "D" = [(Dia, "")]

toPair :: String -> (Suit, Int)
toPair xs = (read s, read t)
  where
    [s, t] = words xs

deck :: [(Suit, Int)]
deck = [(s, t) | s <- [Spade, Heart, Club, Dia], t <- [1..13]]

main :: IO ()
main = do
    getLine
    cards <- fmap toPair . lines <$> getContents
    forM_ (deck \\ cards) $ \(s, t) -> do
        putStrLn $ show s ++ " " ++ show t

