#include <bits/stdc++.h>
using namespace std;
typedef struct card {
  char mark;
  int num;
  int existFlg = 0;
} t_card;
void SetExistFlg(t_card *cardList, char *markList, char inMark, int inNum);
int main() {
  int existCardNum;
  char markList[] = "SHCD";
  t_card cardList[13 * 4];
  char inMark;
  int inNum;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cardList[i * j].mark = markList[i];
      cardList[i * j].num = j + 1;
    }
  }
  cin >> existCardNum;
  for (int i = 0; i < existCardNum; i++) {
    cin >> inMark;
    cin >> inNum;
    SetExistFlg(&cardList[0], markList, inMark, inNum);
  }
  for (int i = 0; i < 4 * 13; i++) {
    if (0 == cardList[i].existFlg) {
      cout << cardList[i].mark << " " << cardList[i].num << endl;
    }
  }
  return 0;
}
void SetExistFlg(t_card *cardList, char *markList, char inMark, int inNum) {
  int markLen = strlen(markList);
  for (int i = 0; i < markLen; i++) {
    if (inMark == markList[i]) {
      cardList[i * 13 + inNum - 1].existFlg = 1;
      break;
    }
  }
}
