#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char SHCD[52];
  int num[52], total = 0, i = 0, j = 0;
  bool card[4][13];
  cin >> total;
  for (i = 0; i < total; i++) {
    cin >> SHCD[i] >> num[i];
  }
  for (i = 0; i < total; i++) {
    if (SHCD[i] == 'S') {
      card[0][num[i]] = true;
    }
    if (SHCD[i] == 'H') {
      card[1][num[i]] = true;
    }
    if (SHCD[i] == 'C') {
      card[2][num[i]] = true;
    }
    if (SHCD[i] == 'D') {
      card[3][num[i]] = true;
    }
  }
  for (j = 0; j < 4; j++) {
    for (i = 0; i < 14; i++) {
      if (card[j][i] == false && i != 0) {
        if (j == 0) {
          cout << "S " << i << endl;
        }
        if (j == 1) {
          cout << "H " << i << endl;
        }
        if (j == 2) {
          cout << "C " << i << endl;
        }
        if (j == 3) {
          cout << "D " << i << endl;
        }
      }
    }
  }
  return 0;
}
