module Main where

import Control.Applicative
import Numeric
import Data.List

main :: IO ()
main = do
  { [n] <- getInts
  ; cards <- loop n
  ; putCards (allcards \\ cards)
  }
  
putCards :: [(Suit, Int)] -> IO()
putCards = putStr . unlines . map showCard

loop :: Int -> IO [(Suit, Int)]
loop 0 = return []
loop n = do
  { c  <- getCard   
  ; cs <- loop (n-1)
  ; return (c:cs)
  }

showCard :: (Suit, Int) -> String
showCard (s,n) = show s ++ " " ++ show n

--

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

allcards :: [(Suit, Int)]
allcards = [ (s,r) | s <- [S, H, C, D], r <- [1..13] ]

getCard :: IO (Suit, Int)
getCard = do
  { [s, r] <- words <$> getLine
  ; return (read s, read r)
  }

getInts :: IO [Int]
getInts = map read . words <$> getLine

putInts :: [Int] -> IO ()
putInts = putStrLn .  unwords . map show

getDoubles :: IO [Double]
getDoubles = map read . words <$> getLine

putDoubles :: [Double] -> IO ()
putDoubles = putStrLn . unwords . map showDouble

showDouble :: Double -> String
showDouble d = showFFloat Nothing d ""

