#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n = 47;
  char type;
  int number;
  cin >> n;
  bool c[3][12] = {};
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      c[i][j] = false;
    }
  }
  while (n) {
    cin >> type >> number;
    if (type == 'S' || type == 's') {
      if (c[0][number] != true && 0 < number && number < 14) {
        c[0][number] = true;
        n--;
      }
    } else if (type == 'H' || type == 'h') {
      if (c[1][number] != true && 0 < number && number < 14) {
        c[1][number] = true;
        n--;
      }
    } else if (type == 'C' || type == 'c') {
      if (c[2][number] != true && 0 < number && number < 14) {
        c[2][number] = true;
        n--;
      }
    } else if (type == 'D' || type == 'd') {
      if (c[3][number] != true && 0 < number && number < 14) {
        c[3][number] = true;
        n--;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (c[i][j] == false) {
        if (i == 0) {
          cout << "S" << j << endl;
        } else if (i == 1) {
          cout << "H" << j << endl;
        } else if (i == 2) {
          cout << "C" << j << endl;
        } else if (i == 3) {
          cout << "D" << j << endl;
        }
      }
    }
  }
  return 0;
}
