<?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 <= 12; $k++)
    {
        $o[] = array($m[$j],(string)$k);
    }
}

$d = array_diff_assoc($o, $t);

foreach ($d as $p) {
    echo $p[0]. " " . $p[1] . "\n";
}