<?php

$n = (int)fgets(STDIN);
$res = '';
while (--$n >= 0) {
  $set = explode(' ', trim(fgets(STDIN)));
  $cards[$set[0]][(int)$set[1]] = 1;
}
foreach(array('S','H','C','D') as $val) {
  for ($i = 1; $i <= 13; $i++) {
    if (!isset($cards[$val][$i])) $res .= "$val $i",PHP_EOL;
  }
}
echo $res;