#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool S[13] = {false}, H[13] = {false}, C[13] = {false}, D[13] = {false};
  char c;
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> c >> x;
    if (c == 'S')
      S[x - 1] = true;
    else if (c == 'H')
      H[x - 1] = true;
    else if (c == 'C')
      C[x - 1] = true;
    else
      D[x - 1] = true;
  }
  for (int i = 0; i < n; i++)
    if (!S[i]) cout << "S " << i + 1 << endl;
  for (int i = 0; i < n; i++)
    if (!H[i]) cout << "H " << i + 1 << endl;
  for (int i = 0; i < n; i++)
    if (!C[i]) cout << "C " << i + 1 << endl;
  for (int i = 0; i < n; i++)
    if (!D[i]) cout << "D " << i + 1 << endl;
  return 0;
}
