#include <bits/stdc++.h>
int main() {
  std::unordered_map<char, int> suit2id;
  suit2id['S'] = 0;
  suit2id['H'] = 1;
  suit2id['C'] = 2;
  suit2id['D'] = 3;
  std::array<char, 4> id2suit = {'S', 'H', 'C', 'D'};
  int buf[4][13] = {};
  int n;
  std::cin >> n;
  char suit;
  int rank;
  for (int i = 0; i < n; i++) {
    std::cin >> suit;
    std::cin >> rank;
    buf[suit2id[suit]][rank - 1] = 1;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (buf[i][j] == 0) {
        std::cout << id2suit.at(i) << ' ' << j + 1 << std::endl;
      }
    }
  }
  return 0;
}
