solve :: [(String, Int)] -> [(String, Int)]
solve existList = filter (\x -> x `notElem` existList) allList
	where
		allList = [(suit, num) | suit <- ["S", "H", "C", "D"], num <- [1..13]]

myPut :: [(String, Int)] -> IO ()
myPut ansList = do
	putStrLn $ unlines . map unwords . map (\(a,b) -> [a, show b]) $ ansList

main = do
	_ <- getLine
	text <- getContents
	myPut $ solve $ map (\[a,b] -> (a, read b :: Int)) . map words . lines $ text