#include <bits/stdc++.h>
using namespace std;
int main() {
  int kazu, sc = 0, hc = 0, cc = 0, dc = 0;
  bool n[4][13] = {false};
  int k[52] = {0};
  string p[52];
  cin >> kazu;
  for (int i = 1; i <= kazu; i++) {
    cin >> p[i - 1] >> k[i - 1];
    if (p[i - 1] == "S") {
      n[0][k[i - 1]] = 1;
    } else if (p[i - 1] == "H") {
      n[1][k[i - 1]] = 1;
    } else if (p[i - 1] == "C") {
      n[2][k[i - 1]] = 1;
    } else {
      n[3][k[i - 1]] = 1;
    }
  }
  for (int j = 0; j <= 3; j++) {
    for (int y = 1; y <= 13; y++) {
      if (n[j][y] == 0) {
        switch (j) {
          case 0:
            cout << "S " << y << endl;
            break;
          case 1:
            cout << "H " << y << endl;
            break;
          case 2:
            cout << "C " << y << endl;
            break;
          case 3:
            cout << "D " << y << endl;
            break;
        }
      }
    }
  }
  return 0;
}
