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