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