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