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