#include <bits/stdc++.h>
typedef struct {
  char suit[100];
  int num;
} SUITS_NUM;
void find(char suit[], SUITS_NUM cards[]) {
  int i, j, k = 0;
  for (i = 0; i <= 13; i++) {
    for (j = 0; j <= 13; j++) {
      if (cards[j].num == i) k++;
    }
    if (k == 0) {
      printf("%s %d\n", suit, i);
    }
    k = 0;
  }
}
void scanner() {
  int n;
  int i;
  char dummy[100];
  SUITS_NUM spade[130], heart[130], club[130], diamond[130];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", dummy);
    if (strcmp(dummy, "S") == 0) {
      sprintf(spade[i].suit, "%s", dummy);
      printf("%s", spade[i].suit);
      scanf("%d", &spade[i].num);
    } else if (strcmp(dummy, "H") == 0) {
      sprintf(heart[i].suit, "H");
      scanf("%d", &heart[i].num);
    } else if (strcmp(dummy, "C") == 0) {
      sprintf(club[i].suit, "C");
      scanf("%d", &club[i].num);
    } else {
      sprintf(diamond[i].suit, "D");
      scanf("%d", &diamond[i].num);
    }
  }
  for (i = 0; i < 4; i++) {
    if (i == 0) find("S", spade);
    if (i == 1) find("H", heart);
    if (i == 2) find("C", club);
    if (i == 3) find("D", diamond);
  }
}
int main(void) {
  scanner();
  return 0;
}
