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