#include <bits/stdc++.h>
using namespace std;
struct hoge {
  hoge() {
    for (int i = 0; i < 13; ++i) {
      isExist[i] = false;
    }
  }
  char pictureType;
  bool isExist[13];
};
int convert(char ch) {
  if (ch == 'S') return 0;
  if (ch == 'H') return 1;
  if (ch == 'C') return 2;
  if (ch == 'D') return 3;
  exit(EXIT_FAILURE);
}
int main() {
  struct hoge cardResource[4];
  cardResource[0].pictureType = 'S';
  cardResource[1].pictureType = 'H';
  cardResource[2].pictureType = 'C';
  cardResource[3].pictureType = 'D';
  int n;
  cin >> n;
  string str;
  int num;
  int type;
  for (int i = 0; i < n; ++i) {
    cin >> str >> num;
    type = convert(str[0]);
    cardResource[type].isExist[num - 1] = true;
  }
  for (int j = 0; j < 4; ++j) {
    for (int i = 0; i < 13; ++i) {
      if (!cardResource[j].isExist[i]) {
        cout << cardResource[j].pictureType << " " << i + 1 << endl;
      }
    }
  }
  return 0;
}
