#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  int y;
  int s[13], h[13], c[13], d[13];
  int i = 0, i2, i3 = 0, a;
  cin >> a;
  while (i < a) {
    cin >> x;
    cin >> y;
    if (x == "S") {
      s[y - 1] = y - 1;
    }
    if (x == "H") {
      h[y - 1] = y - 1;
    }
    if (x == "C") {
      c[y - 1] = y - 1;
    }
    if (x == "D") {
      d[y - 1] = y - 1;
    }
    i2 = i;
    i++;
  }
  for (int i5 = 0; i5 < 13; i5++) {
    if (s[i5] != i5) {
      cout << "S " << i5 + 1 << endl;
    }
    if (h[i5] != i5) {
      cout << "H " << i5 + 1 << endl;
    }
    if (c[i5] != i5) {
      cout << "C " << i5 + 1 << endl;
    }
    if (d[i5] != i5) {
      cout << "D " << i5 + 1 << endl;
    }
  }
  return 0;
}
