<?php
$a = trim(fgets(STDIN));
$suit = array("S", "H", "C", "D");
$card_set = [];
foreach($suit as $kind){
    for($i = 1; $i <= 13; $i++){
        array_push($card_set, $kind." ".$i);
    }
}
$input_set =[];
while($input = trim(fgets(STDIN))){
array_push($input_set,$input);
}
$missing_card = array_diff($card_set, $input_set);
if($a !== 52){
echo implode(PHP_EOL,$missing_card);
}
?>