#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch, card[4][13] = {false};
  int n, i, a, j, k;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ch >> a;
    if (ch == 'S') {
      card[0][a] = true;
    }
    if (ch == 'H') {
      card[1][a] = true;
    }
    if (ch == 'C') {
      card[2][a] = true;
    }
    if (ch == 'D') {
      card[3][a] = true;
    }
  }
  for (j = 0; j < 4; j++) {
    for (k = 1; k < 14; k++) {
      if (!card[j][k]) {
        if (j == 0) {
          cout << 'S' << " " << k << endl;
        }
        if (j == 1) {
          cout << 'H' << " " << k << endl;
        }
        if (j == 2) {
          cout << 'C' << " " << k << endl;
        }
        if (j == 3) {
          cout << 'D' << " " << k << endl;
        }
      }
    }
  }
  return 0;
}
