#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];
};
void convert(char& pattern) {
  switch (pattern) {
    case 'S':
      pattern = 0;
      break;
    case 'H':
      pattern = 1;
      break;
    case 'C':
      pattern = 2;
      break;
    case 'D':
      pattern = 3;
      break;
    default:
      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;
  int num;
  char pattern;
  for (int i = 0; i < n; ++i) {
    cin >> pattern >> num;
    convert(pattern);
    cardResource[pattern].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;
}
