#include <bits/stdc++.h>
using namespace std;
int main() {
  bool cards[4][13] = {false};
  int N;
  int type, rank;
  char ctype;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> ctype >> rank;
    switch (ctype) {
      case 'S':
        type = 0;
        break;
      case 'H':
        type = 1;
        break;
      case 'C':
        type = 2;
        break;
      case 'D':
        type = 3;
        break;
    }
    rank--;
    cards[type][rank] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (cards[i][j] == false) {
        switch (i) {
          case 0:
            cout << "S ";
            break;
          case 1:
            cout << "H ";
            break;
          case 2:
            cout << "C ";
            break;
          case 3:
            cout << "D ";
            break;
        }
        cout << " " << j + 1 << endl;
      }
    }
  }
  return 0;
}
