#include <bits/stdc++.h>
int main(void) {
  int card[4][13] = {};
  int n, x, i, j;
  char ch[1];
  scanf("%d", &n);
  for (i = 0; i < n * 2; i++) {
    scanf("%c%d", &ch[0], &x);
    if (ch[0] == 'S') card[0][x - 1] = 1;
    if (ch[0] == 'H') card[1][x - 1] = 1;
    if (ch[0] == 'C') card[2][x - 1] = 1;
    if (ch[0] == 'D') card[3][x - 1] = 1;
  }
  puts("");
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (card[i][j] != 1) {
        if (i == 0) printf("S %d\n", j + 1);
        if (i == 1) printf("H %d\n", j + 1);
        if (i == 2) printf("C %d\n", j + 1);
        if (i == 3) printf("C %d\n", j + 1);
      }
    }
  }
  return 0;
}
