#include <bits/stdc++.h>
template <class T, size_t N>
size_t countof(const T (&array)[N]) {
  return N;
}
using namespace std;
const string l[4]{"S", "H", "C", "D"};
void solver() {
  string tes = "S";
  string test = " ";
  cout << tes + test;
  cout << test << endl;
  map<string, int> m;
  for (int i = 0; i < (int)countof(l); ++i)
    for (int j = 0; j < (int)13; ++j) m[l[i] + " " + to_string(j + 1)] = 1;
  int N;
  cin >> N;
  for (int i = 0; i < (int)N; ++i) {
    string c;
    int num;
    cin >> c >> num;
    m[c + " " + to_string(num)] += 1;
  }
  for (int i = 0; i < (int)countof(l); ++i)
    for (int j = 0; j < (int)13; ++j)
      if (m[l[i] + " " + to_string(j + 1)] == 1)
        cout << l[i] + " " + to_string(j + 1) << endl;
}
int main() {
  solver();
  return 0;
}
