#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char s;
  int x;
  bool missing[100][14];
  string str = "SHCD";
  for (int i = 0; i < N; i++) {
    cin >> s >> x;
    missing[s - 'A'][x] = true;
  }
  for (int i = 0; i < str.size(); i++) {
    for (int l = 1; l < 14; l++) {
      if (missing[str[i] - 'A'][l] == false) cout << str[i] << " " << l << endl;
    }
  }
  return 0;
}
