<?php
$haveCardNum = trim(fgets(STDIN));
$cardCheckList = createCardCheckList();
 
for ($i = 0; $i < $haveCardNum; $i++) {
    list($mark, $num) = getSpacesByExplodeTrimInput();
    $cardCheckList[$mark][$num] = 'check';
}
 
foreach ($cardCheckList as $mark => $value) {
    for ($cardNum = 1; $cardNum <= 13; $cardNum++) {
        if (! isset($cardCheckList[$mark][$cardNum])) {
            echo sprintf('%s %d', $mark, $cardNum), PHP_EOL;
        }
    }
}
 
function getSpacesByExplodeTrimInput()
{
    return explode(' ', trim(fgets(STDIN)));
}
 
function createCardCheckList()
{
    foreach(array('S', 'H', 'C', 'D') as $mark) {
        $checkList = array( "$mark" => array_fill(1, 13, null));
    }
    return $checkList;
}