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