#include <bits/stdc++.h>
using namespace std;
int identify(char a) {
  int index;
  if (a == 'D') {
    index = 4;
  } else if (a == 'H') {
    index = 2;
  } else if (a == 'S') {
    index = 1;
  } else if (a == 'C') {
    index = 3;
  }
  return index;
}
char mark(int b) {
  char outmark;
  if (b == 4) {
    outmark = 'D';
  } else if (b == 1) {
    outmark = 'H';
  } else if (b == 2) {
    outmark = 'S';
  } else if (b == 3) {
    outmark = 'C';
  }
  return outmark;
}
int main() {
  int trump[14][5];
  int maisuu;
  cin >> maisuu;
  int innumber;
  char inmark;
  for (int i = 1; i <= maisuu; i++) {
    cin >> inmark >> innumber;
    trump[innumber][identify(inmark)] = 1;
  }
  for (int j = 1; j <= 4; j++) {
    for (int k = 1; k <= 13; k++) {
      if (trump[k][j] = 0) {
        cout << mark(j) << " " << k << "\n";
      }
    }
  }
  return 0;
}
