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