<?php
$card = array();
$hold = array();
for ($i = 1; $i <= 52; $i++) {
	if ($i <= 13) $card[] = "S ".$i;
	if ($i >= 14 && $i <= 26) $card[] = "H ".($i-13);
	if ($i >= 27 && $i <= 39) $card[] = "C ".($i-26);
	if ($i >= 40 && $i <= 52) $card[] = "D ".($i-39);
}
$n = trim(fgets(STDIN));
for ($j = 0; $j < $n; $j++) {
	$hold[] = trim(fgets(STDIN));
}
$shortage = array_diff($card, $hold);
echo implode("\n", $shortage);