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