#include <bits/stdc++.h>
using namespace std;
int main() {
  valarray<bool> C(false, 52);
  int n, a;
  char s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> a;
    if (s == 'S') C[a] = true;
    if (s == 'H') C[a * 13] = true;
    if (s == 'C') C[a * 26] = true;
    if (s == 'D') C[a * 39] = true;
  }
  int cnt = 1;
  int s_n = 0;
  char suit[] = "SHCD";
  for (int i = 0; i < C.size(); i++) {
    if (!C[i]) cout << suit[s_n] << " " << cnt << endl;
    cnt++;
    if (cnt == 14) {
      cnt = 1;
      s_n++;
    }
  }
  return 0;
}
