#include <bits/stdc++.h>
using namespace std;
int main() {
  bool cards[4][14];
  int n, x;
  char mark;
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      cards[i][j] = 0;
    }
  }
  cin >> n;
  for (int k = 0; k < n; k++) {
    cin >> mark >> x;
    if (mark == 'S') cards[0][x] = 1;
    if (mark == 'H') cards[1][x] = 1;
    if (mark == 'C') cards[2][x] = 1;
    if (mark == 'D') cards[3][x] = 1;
  }
  for (int s = 0; s < 4; s++) {
    for (int t = 1; t <= 13; t++) {
      if (cards[s][t]) continue;
      if (s == 0) mark == 'S';
      if (s == 1) mark == 'H';
      if (s == 2) mark == 'C';
      if (s == 3) mark == 'D';
      cout << mark << " " << t << endl;
    }
  }
  return 0;
}
