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