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