<?php
$num = trim(fgets(STDIN)); 
$trump = cardset();

for($i = 0; $i < $num; $i++){
    list($a,$b) = explode(" ", trim(fgets(STDIN)));
    $trump[$a][$b] = "check";
}

for($i = 1; $i <= 13; $i++){
    foreach($trump as $mark => $int){
        if(!isset($trump[$mark][$i])){
            echo "$mark".' '.$i, PHP_EOL;
        }
    }
}

function cardset(){
    return array(
        "S" => array_fill(1, 13, null),
        "H" => array_fill(1, 13, null),
        "C" => array_fill(1, 13, null),
        "D" => array_fill(1, 13, null)
        );
}