#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, bool[13]> cards;
  vector<char> suites = {'S', 'H', 'C', 'D'};
  map<char, int> suitesDict;
  cards[0][13] = {};
  cards[1][13] = {};
  cards[2][13] = {};
  cards[3][13] = {};
  suitesDict['S'] = 0;
  suitesDict['H'] = 1;
  suitesDict['C'] = 2;
  suitesDict['D'] = 3;
  int n, num;
  char s;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s >> num;
    cards[suitesDict[s]][num - 1] = true;
  }
  for (auto pc : cards) {
    for (int i = 0; i < 13; ++i) {
      if (!pc.second[i]) {
        cout << suites[pc.first] << ' ' << i + 1 << endl;
      }
    }
  }
  return 0;
}
