import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Text.Printf

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

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

main :: IO ()
main = do
  n <- readLn
  cs <- replicateM n readLn
  forM_ (solve cs) $ \c -> do
    print c

solve :: [Card] -> [Card]
solve = S.toList . (s S.\\) . S.fromList
 where
  s = S.fromList $ ($) <$> [S, H, C, D] <*> [1..13]

