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