import Control.Applicative

func (a,b) = a ++ " " ++ (show b)

main = do{
    n <- getLine;
    input <- map words . lines <$> getContents;
    let{
        cards = [ ((x!!0),((read::String->Int) (x!!1))) | x<-input ];
        allcards = [ (mark,number) | mark<-["S","H","C","D"], number<-[1..13] ];
        restcards = [ x | x<-allcards, notElem x cards ];
    };
    mapM_ putStrLn $ (map func) restcards;
}