#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string type;
  int number = 1;
  bool c[3][12] = {};
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      c[i][j] = false;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> type >> number;
    if (type == "S" || type == "s") {
      cout << "S ?????´" << endl;
      c[0][number - 1] = true;
      cout << c[0][number - 1] << endl;
    } else if (type == "H" || type == "h") {
      c[1][number] = true;
    } else if (type == "C" || type == "c") {
      c[2][number] = true;
    } else if (type == "D" || type == "d") {
      c[3][number] = true;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (c[i][j] == 0) {
        if (i == 0) {
          cout << "S" << j + 1;
        } else if (i == 1) {
          cout << "H" << j + 1;
        } else if (i == 2) {
          cout << "C" << j + 1;
        } else if (i == 3) {
          cout << "D" << j + 1;
        }
      }
    }
  }
  return 0;
}
