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