<?php

$num = trim(fgets(STDIN));

$array = array(
    'S' => array_fill(0, 13, false),
    'H' => array_fill(0, 13, false),
    'C' => array_fill(0, 13, false),
    'D' => array_fill(0, 13, false)
    );
    
    
$arrayAnswer = array();
for($i = 0; $i < $num; $i++){
    list($mark, $nums) = explode(" ", trim(fgets(STDIN)));
    
    $array["$mark"]["$nums" - 1] = $nums;
}

foreach($array as $key => $val){
    for($i = 1; $i <= 13; $i++){
        if(! $array[$key][$i - 1]){
            array_push($arrayAnswer, "$key $i");
        }
    }
}

echo implode(PHP_EOL, $arrayAnswer), PHP_EOL;