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