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