#include <bits/stdc++.h>
int f[4][13];
char *suit = "SHCD";
int main(void) {
  int i, j, n, rank;
  char mark;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c%d", &mark, &rank);
    for (j = 0; suit[j] != '\0' && suit[j] != mark; j++)
      ;
    f[j][rank - 1] = 1;
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (f[i][j]) continue;
      printf("%c %d\n", suit[i], j + 1);
    }
  }
  return 0;
}
