#include <bits/stdc++.h>
using namespace std;
int main() {
  int size = 13;
  int spade[13] = {}, heart[13], club[13], diamond[13];
  int maxn;
  cin >> maxn;
  for (int i = 0; i < maxn; i++) {
    string suits = "";
    int num = 0;
    cin >> suits >> num;
    if (suits == "S") {
      spade[num - 1] = 1;
    }
    if (suits == "H") {
      heart[num - 1] = 1;
    }
    if (suits == "C") {
      club[num - 1] = 1;
    }
    if (suits == "D") {
      diamond[num - 1] = 1;
    }
  }
  for (int j = 0; j < size; j++) {
    if (spade[j] == 0) {
      cout << "S " << j + 1 << endl;
    }
  }
  for (int j = 0; j < size; j++) {
    if (heart[j] == 0) {
      cout << "H " << j + 1 << endl;
    }
  }
  for (int j = 0; j < size; j++) {
    if (club[j] == 0) {
      cout << "C " << j + 1 << endl;
    }
  }
  for (int j = 0; j < size; j++) {
    if (diamond[j] == 0) {
      cout << "D " << j + 1 << endl;
    }
  }
  return 0;
}
