#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int rec;
  char mark;
  int s[13];
  int h[13];
  int c[13];
  int d[13];
  for (int i = 0; i < 13; i++) {
    s[i] = 1;
    h[i] = 1;
    c[i] = 1;
    d[i] = 1;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mark >> rec;
    if (mark == 'S') s[rec] = 0;
    if (mark == 'H') h[rec] = 0;
    if (mark == 'C') c[rec] = 0;
    if (mark == 'D') d[rec] = 0;
  }
  for (int i = 0; i < 13; i++) {
    if (s[i + 1] == 1) {
      cout << "S " << i + 1 << endl;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (h[i + 1] == 1) {
      cout << "H " << i + 1 << endl;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (c[i + 1] == 1) {
      cout << "C " << i + 1 << endl;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (d[i + 1] == 1) {
      cout << "D " << i + 1 << endl;
    }
  }
  return 0;
}
