#include <bits/stdc++.h>
using namespace std;
const int M = 100000;
const double pi = 3.141592653589;
int main() {
  int n;
  bool a[4][13] = {false};
  char b[M];
  int c[M];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> b[i] >> c[i];
    if (b[i] == 'S')
      a[0][c[i] - 1] = true;
    else if (b[i] == 'H')
      a[1][c[i] - 1] = true;
    else if (b[i] == 'C')
      a[2][c[i] - 1] = true;
    else if (b[i] == 'D')
      a[3][c[i] - 1] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int k = 0; k < 13; k++) {
      if (!a[i][k]) {
        if (i == 0)
          cout << "S " << k << endl;
        else if (i == 1)
          cout << "H " << k << endl;
        else if (i == 2)
          cout << "C " << k << endl;
        else if (i == 3)
          cout << "D " << k << endl;
      }
    }
  }
  return 0;
}
