#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<bool> S(14, false), H(14, false), C(14, false), D(14, false);
  char suit;
  int num;
  while (--n) {
    cin >> suit >> num;
    switch (suit) {
      case 'S':
        S[num] = true;
        break;
      case 'H':
        H[num] = true;
        break;
      case 'C':
        C[num] = true;
        break;
      case 'D':
        D[num] = true;
        break;
    }
  }
  for (int i = 1; i <= 13; ++i) {
    if (!S[i])
      cout << "S " << i << endl;
    else if (!H[i])
      cout << "H " << i << endl;
    else if (!C[i])
      cout << "C " << i << endl;
    else if (!D[i])
      cout << "D " << i << endl;
  }
  return 0;
}
