#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  map<char, vector<int>> cards;
  vector<char> marks = {'S', 'H', 'C', 'D'};
  for (char c : marks) {
    vector<int> v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
    cards.insert(make_pair(c, v));
  }
  int input_num = 0;
  cin >> input_num;
  char m;
  int n;
  for (int i = 0; i < input_num; i++) {
    cin >> m >> n;
    vector<int> v = cards[m];
    v.erase(remove(v.begin(), v.end(), n), v.end());
    cards[m] = v;
  }
  for (char c : marks) {
    for (int i : cards[c]) {
      cout << c << " " << i << endl;
    }
  }
  return 0;
}
