import Control.Applicative
import Control.Monad
import Data.List

makeExistCards :: String -> [[String]]
makeExistCards = (map words) . lines

main = do
    lines <- getContents
    let cards = [[x, (show y)] | x <- ["S", "H", "C", "D"], y <- [1..13]]
        existCards = makeExistCards lines
        noExistCards = foldr (\x acc -> delete x acc) cards existCards    

    mapM_ putStrLn $ map unwords noExistCards
