import Data.Functor( (<$>))
import Data.List( foldl', delete)

main = do
    getLine
    cards <- lines <$> getContents
    let
	allcards = spades ++ hearts ++ clubs ++ diamonds
	  where
	    spades = ("S "++) <$> numbers
	    hearts = ("H "++) <$> numbers
	    clubs = ("C "++) <$> numbers
	    diamonds = ("D "++) <$> numbers
	    numbers = show <$> [1..13]

	remain = foldl' (flip delete) allcards cards

    putStrLn `mapM_` remain


