import Data.List

main = getContents >>= putOut.formatOut.calc.formatIn
  where putOut = putStrLn.reverse.dropWhile (\c -> c=='\n' || c==' ').reverse

formatIn :: String -> [[String]]
formatIn = map words.tail.lines

formatOut :: [[String]] -> String
formatOut = unlines.map (init.unlines)

calc :: [[String]] -> [[String]]
calc n = [f "S", f "H", f "D", f "C"]
  where f c = map unwords $(g c)  \\ (filter (\s -> (head s) == c) n)
        g c =  map (\x -> [c,show x]) [1..13]