import std.stdio, std.array, std.conv, std.string;

struct Card {
  string suit;
  int number;

  size_t toHash() {
    int a = 100;
    string[] suits = ["S", "H", "C", "D"];
    foreach (int i, s; suits) {
      if (s == suit) a = i;
    }

    return 13 * a + number;
  }
}

void main() {
  int n = to!int(chomp(readln()));
  bool[string][14] set;

  for (int i = 0; i < n; ++i) {
    string[] s = split(readln());
    set[to!int(s[1])][s[0]] = true;
  }

  string[] suits = ["S", "H", "C", "D"];
  foreach (i; suits) {
    for (int j = 1; j <= 13; ++j) {
      if (i in set[j]) continue;
      writef("%s %d\n", i, j);
    }
  }
}

// void main() {
//   int n = to!int(chomp(readln()));
//   bool[Card] set;
//
//   for (int i = 0; i < n; ++i) {
//     string[] s = split(readln());
//     set[Card(s[0], to!int(s[1]))] = true;
//   }
//
//   string[] suits = ["S", "H", "C", "D"];
//   foreach (i; suits) {
//     for (int j = 1; j <= 13; ++j) {
//       if (Card(i, j) in set) continue;
//       writef("%s %d\n", i, j);
//     }
//   }
// }