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