#include <bits/stdc++.h>
using namespace std;
int main() {
  int kazu;
  bool n[4][13] = {0};
  int k[52];
  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 r = 0; r <= 3; r++) {
    for (int t = 0; t <= 12; t++) {
      if (n[r][k[t]] == 0) {
        switch (r) {
          case 0:
            cout << "S " << (t + 1) << endl;
            break;
          case 1:
            cout << "H " << (t + 1) << endl;
            break;
          case 2:
            cout << "C " << (t + 1) << endl;
            break;
          case 3:
            cout << "D " << (t + 1) << endl;
            break;
        }
      }
    }
  }
  return 0;
}
