#include <bits/stdc++.h>
using namespace std;
int main() {
  int card[4][13], i, j, t, n;
  string s;
  cin >> n;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) card[i][j] = 1;
  }
  for (i = 1; i <= n; i++) {
    cin >> s >> t;
    if (s == "S") card[0][t - 1] = 0;
    if (s == "H") card[1][t - 1] = 0;
    if (s == "C") card[2][t - 1] = 0;
    if (s == "D") card[3][t - 1] = 0;
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (card[i][j]) {
        if (i == 0) cout << "S " << j + 1 << endl;
        if (i == 1) cout << "H " << j + 1 << endl;
        if (i == 2) cout << "C " << j + 1 << endl;
        if (i == 3) cout << "D " << j + 1 << endl;
      }
    }
  }
  cout << endl;
  return 0;
}
