import Data.List

main = getContents >>= putStr.formatOut.calc.formatIn

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

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