#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char a[52], ans[52] = {};
  int num[52], n, i, j, k = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> num[i];
    if (a[i] == 'S') {
      ans[4 * num[i] - 4] = 1;
    } else if (a[i] == 'H') {
      ans[4 * num[i] - 3] = 1;
    } else if (a[i] == 'C') {
      ans[4 * num[i] - 2] = 1;
    } else if (a[i] == 'D') {
      ans[4 * num[i] - 1] = 1;
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (ans[4 * i - 4] == 0) cout << 'S' << " " << i << endl;
    if (ans[4 * i - 3] == 0) cout << 'H' << " " << i << endl;
    if (ans[4 * i - 1] == 0) cout << 'D' << " " << i << endl;
    if (ans[4 * i - 2] == 0) cout << 'C' << " " << i << endl;
  }
}
