#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, b;
  cin >> a;
  char c;
  vector<int> s(14);
  vector<int> h(14);
  vector<int> cc(14);
  vector<int> d(14);
  for (int i = 0; i < a; i++) {
    cin >> c;
    if (c == 'S') {
      cin >> b;
      s.at(b) = b;
    } else if (c = 'H') {
      cin >> b;
      h.at(b) = b;
    } else if (c = 'C') {
      cin >> b;
      cc.at(b) = b;
    } else if (c = 'D') {
      cin >> b;
      d.at(b) = b;
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (s.at(i) == 0) cout << "S " << i << endl;
  }
  for (int i = 1; i <= 13; i++) {
    if (h.at(i) == 0) cout << "H " << i << endl;
  }
  for (int i = 1; i <= 13; i++) {
    if (cc.at(i) == 0) cout << "C " << i << endl;
  }
  for (int i = 1; i <= 13; i++) {
    if (d.at(i) == 0) cout << "D " << i << endl;
  }
  return 0;
}
