#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch;
  int num[52], total;
  bool card[4][13];
  cin >> total;
  for (int i = 0; i < total; i++) {
    for (int n = 0; i < 4; n++) {
      cin >> ch >> num[i];
      if (ch == 'S') {
        card[0][num[i]] = true;
      }
      if (ch == 'H') {
        card[1][num[i]] = true;
      }
      if (ch == 'C') {
        card[2][num[i]] = true;
      }
      if (ch == 'D') {
        card[3][num[i]] = true;
      }
    }
  }
  for (int j = 0; j < 4; j++) {
    for (int i = 0; i < 14; i++) {
      if (card[j][i] == false && i != 0) {
        if (j == 0) {
          cout << "S " << i << endl;
        }
        if (j == 1) {
          cout << "H " << i << endl;
        }
        if (j == 2) {
          cout << "C " << i << endl;
        }
        if (j == 3) {
          cout << "D " << i << endl;
        }
      }
    }
  }
  return 0;
}
