#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char c[n];
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> c[i] >> a[i];
  }
  int t[13][4];
  for (int i = 0; i < n; i++) {
    if (c[i] == 'S') {
      t[a[i] - 1][0] = 1;
    } else if (c[i] == 'H') {
      t[a[i] - 1][1] = 1;
    } else if (c[i] == 'C') {
      t[a[i] - 1][2] = 1;
    } else if (c[i] == 'D') {
      t[a[i] - 1][3] = 1;
    }
  }
  char d;
  for (int i = 0; i < 13; i++) {
    for (int j = 0; j < 4; j++) {
      if (t[i][j] == 0) {
        if (j == 0)
          d = 'S';
        else if (j == 1)
          d = 'H';
        else if (j == 2)
          d = 'C';
        else if (j == 3)
          d = 'D';
        cout << d << " " << i + 1 << endl;
      }
    }
  }
}
