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