#include <bits/stdc++.h>
int main() {
  char si;
  int n, mi;
  int v[4][13] = {};
  std::cin >> n;
  for (int a = 0; a < n; a++) {
    std::cin >> si >> mi;
    if (si == 'S') v[0][mi] = 1;
    if (si == 'H') v[1][mi] = 1;
    if (si == 'C') v[2][mi] = 1;
    if (si == 'D') v[3][mi] = 1;
  }
  for (int s = 0; s < 4; s++) {
    for (int m = 0; m < 14; m++) {
      if (v[s][m] != 1 && m != 0) {
        if (s == 0) std::cout << "S " << m << std::endl;
        if (s == 1) std::cout << "H " << m << std::endl;
        if (s == 2) std::cout << "C " << m << std::endl;
        if (s == 3) std::cout << "D " << m << std::endl;
      }
    }
  }
  return 0;
}
