import Control.Applicative
import Data.List

main = do
	let all = [ [m,show n] | m<-["S","H","C","D"], n<-[1..13] ]
	num <- getLine
	exist <- map words . lines <$> getContents
	let rest = delete exist all
	mapM_ putStrLn $ (map unwords) rest