<?php
$n = trim(fgets(STDIN));
$t = [];
for($i = 0; $i < $n; $i++)
{
    $in = explode(" ", trim(fgets(STDIN)));
    $t[] = $in;
}

$m = array("S", "H", "C", "D");
$o = [];
for($j = 0; $j < count($m); $j++)
{
    for($k = 1; $k <= 13; $k++)
    {
        $o[] = array($m[$j],(string)$k);
    }
}

$r = $o;

for($l = 0; $l < count($o); $l++)
{
    for($n = 0; $n <= count($t); $n++)
    {
        if($o[$l][0] == $t[$n][0] && $o[$l][1] == $t[$n][1])
        {
            unset($r[$l]);
        }
    }
}

$r = array_values($r);

for($m = 0; $m < count($r); $m++)
{
    echo $r[$m][0] . " " . (int)$r[$m][1] . "\n";
}