import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.regex, std.conv, std.stdio, std.typecons;

void main()
{
  auto n = readln.chomp.to!size_t;

  auto cards = new bool[](52);
  foreach (_; 0..n) {
    auto c = readln.chomp;
    cards[cardStoI(c)] = true;
  }

  foreach (int i, c; cards)
    if (!c) writeln(cardItoS(i));
}

int cardStoI(string s)
{
  auto rd = s.split;
  auto suite = rd[0], rank = rd[1].to!int;
  return suiteStoI(suite) * 13 + rank - 1;
}

string cardItoS(int s)
{
  return suiteItoS(s / 13) ~ " " ~ (s % 13 + 1).to!string;
}

const auto suites = ["S", "H", "C", "D"];

int suiteStoI(string s)
{
  return suites.countUntil!(a => a == s).to!int;
}

string suiteItoS(int s)
{
  return suites[s];
}