#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, y, s[14], h[14], c[14], d[14];
  char x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cin >> y;
    if (x == 'S') {
      s[y - 1] = y;
    } else if (x == 'H') {
      h[y - 1] = y;
    } else if (x == 'C') {
      c[y - 1] = y;
    } else if (x == 'D') {
      d[y - 1] = y;
    }
  }
  for (int i2 = 0; i2 < 13; i2++) {
    if (s[i2] != i2 + 1) {
      cout << "S " << i2 + 1 << endl;
    }
  }
  for (int i3 = 0; i3 < 13; i3++) {
    if (h[i3] != i3 + 1) {
      cout << "H " << i3 + 1 << endl;
    }
  }
  for (int i4 = 0; i4 < 13; i4++) {
    if (c[i4] != i4 + 1) {
      cout << "C " << i4 + 1 << endl;
    }
  }
  for (int i5 = 0; i5 < 13; i5++) {
    if (d[i5] != i5 + 1) {
      cout << "D " << i5 + 1 << endl;
    }
  }
  return 0;
}
