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