#include <bits/stdc++.h>
int main(void) {
  int n;
  int rank;
  int i, j;
  char mark[256];
  char *sp = "SHCD";
  int cards[4][13] = {0};
  scanf("%d", &n);
  if (n > 52) {
    return 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%s %d", mark, &rank);
    if (rank >= 1 && rank <= 13) {
      for (j = 0; j < 4; j++) {
        if (strcmp(mark, sp + j) == 0) {
          cards[j][rank - 1] = 1;
        } else {
          return 0;
        }
      }
    } else {
      return 0;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (cards[i][j] == 0) {
        switch (i) {
          case 0:
            printf("S");
            break;
          case 1:
            printf("H");
            break;
          case 2:
            printf("C");
            break;
          case 3:
            printf("D");
            break;
          default:
            break;
        }
        printf(" %d\n", j + 1);
      }
    }
  }
  return 0;
}
