#include <bits/stdc++.h>
using namespace std;
int main() {
  int S[13] = {};
  int H[13] = {};
  int C[13] = {};
  int D[13] = {};
  int n;
  char gara;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int kawari;
    cin >> gara;
    if (gara == 'S') {
      cin >> kawari;
      S[kawari - 1] = 1;
    }
    if (gara == 'H') {
      cin >> kawari;
      H[kawari - 1] = 1;
    }
    if (gara == 'C') {
      cin >> kawari;
      C[kawari - 1] = 1;
    }
    if (gara == 'D') {
      cin >> kawari;
      D[kawari - 1] = 1;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (S[i] == 0) {
      cout << "S " << i << "\n";
    }
  }
  for (int i = 0; i < 13; i++) {
    if (H[i] == 0) {
      cout << "H " << i << "\n";
    }
  }
  for (int i = 0; i < 13; i++) {
    if (C[i] == 0) {
      cout << "C " << i << "\n";
    }
  }
  for (int i = 0; i < 13; i++) {
    if (D[i] == 0) {
      cout << "D " << i << "\n";
    }
  }
  return 0;
}
