#include <bits/stdc++.h>
using namespace std;
int kazu, c[5][14] = {0};
string k, g;
int in() {
  int n;
  cin >> n;
  for (int a = 0; a < n; a++) {
    cin >> k >> kazu;
    if (k == "S") c[1][kazu] = 1;
    if (k == "H") c[2][kazu] = 1;
    if (k == "C") c[3][kazu] = 1;
    if (k == "D") c[4][kazu] = 1;
  }
}
int out() {
  for (int a = 1; a < 5; a++) {
    for (int b = 1; b < 14; b++) {
      if (c[a][b] != 1)
        if (a == 1) g = "S";
      if (a == 2) g = "H";
      if (a == 3) g = "C";
      if (a == 4) g = "D";
      cout << g << " " << b << endl;
    }
  }
}
int main() {
  in();
  out();
  return 0;
}
