#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  char moji[53];
  int num[53];
  int snum[14] = {};
  int hnum[14] = {};
  int cnum[14] = {};
  int dnum[14] = {};
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> moji[i] >> num[i];
  }
  for (int t = 1; t <= 13; t++) {
    for (int i = 1; i <= n; i++) {
      if ((moji[i] == 'S') && (num[i] == t)) {
        snum[t] = 1;
        break;
      }
    }
  }
  for (int t = 1; t <= 13; t++) {
    for (int i = 1; i <= n; i++) {
      if ((moji[i] == 'H') && (num[i] == t)) {
        hnum[t] = 1;
        break;
      }
    }
  }
  for (int t = 1; t <= 13; t++) {
    for (int i = 1; i <= n; i++) {
      if ((moji[i] == 'C') && (num[i] == t)) {
        cnum[t] = 1;
        break;
      }
    }
  }
  for (int t = 1; t <= 13; t++) {
    for (int i = 1; i <= n; i++) {
      if ((moji[i] == 'D') && (num[i] == t)) {
        dnum[t] = 1;
        break;
      }
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (snum[i] != 1) {
      cout << "S" << i << "\n";
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (hnum[i] != 1) {
      cout << "H" << i << "\n";
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (cnum[i] != 1) {
      cout << "C" << i << "\n";
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (dnum[i] != 1) {
      cout << "D" << i << "\n";
    }
  }
  return 0;
}
