#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num;
  string S;
  cin >> n;
  int cards[4][13];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cards[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> S >> num;
    if (S == "S") cards[0][num - 1] = 1;
    if (S == "H") cards[1][num - 1] = 1;
    if (S == "C") cards[2][num - 1] = 1;
    if (S == "D") cards[3][num - 1] = 1;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (cards[i][j] == 0) {
        if (i == 0)
          cout << "S"
               << " " << j + 1 << endl;
        if (i == 1)
          cout << "H"
               << " " << j + 1 << endl;
        if (i == 2)
          cout << "C"
               << " " << j + 1 << endl;
        if (i == 3)
          cout << "D"
               << " " << j + 1 << endl;
      }
    }
  }
  cout << endl;
  return 0;
}
