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