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