#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n];
  char s[n];
  int y[52] = {0};
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> x[i];
  }
  for (int j = 0; j < n; j++) {
    int p = x[j];
    int a = p - 1;
    int b = p + 12;
    int c = p + 25;
    int d = p + 38;
    if (s[j] == 'S') {
      x[j] = y[a];
    } else if (s[j] == 'H') {
      x[j] = y[b];
    } else if (s[j] == 'C') {
      x[j] = y[c];
    } else if (s[j] == 'D') {
      x[j] = y[d];
    }
  }
  for (int r = 0; r < 52; r++) {
    if (y[r] == 0) {
      if (r < 13) {
        cout << 'S' << " " << r + 1 << "\n";
      } else if (r > 12 && r < 26) {
        cout << 'H' << " " << r - 12 << "\n";
      } else if (r > 25 && r < 39) {
        cout << 'C' << " " << r - 25 << "\n";
      } else if (r > 38) {
        cout << 'D' << " " << r - 38 << "\n";
      }
    }
  }
  return 0;
}
