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