#include <bits/stdc++.h>
int main() {
  int n, b, c, d, e, f, g;
  int cards[4][13];
  cards[0][10] = 0;
  cards[1][1] = 0;
  cards[3][4] = 0;
  cards[3][7] = 0;
  char a;
  scanf("%d", &n);
  for (c = 0; n > 0; n--) {
    scanf("%s %d", &a, &b);
    if (a == 'S') {
      f = 0;
    } else if (a == 'H') {
      f = 1;
    } else if (a == 'C') {
      f = 2;
    } else if (a == 'D') {
      f = 3;
    }
    g = b - 1;
    cards[f][g] = 1;
  }
  for (d = 0; d < 4; d++) {
    for (e = 0; e < 13; e++) {
      if (cards[d][e] != 1 && d == 0) {
        printf("S %d\n", e + 1);
      } else if (cards[d][e] != 1 && d == 1) {
        printf("H %d\n", e + 1);
      } else if (cards[d][e] != 1 && d == 2) {
        printf("C %d\n", e + 1);
      } else if (cards[d][e] != 1 && d == 3) {
        printf("D %d\n", e + 1);
      }
    }
  }
  return 0;
}
