#include <bits/stdc++.h>
int main(void) {
  typedef struct card {
    char suit;
    int rank;
    int left;
  } card;
  card cards[52];
  int i, j, num_left;
  char suit_left;
  int rank_left;
  for (i = 0; i < 52; i++) {
    char mark;
    if (i < 13)
      mark = 'S';
    else if (i < 26)
      mark = 'H';
    else if (i < 39)
      mark = 'C';
    else
      mark = 'D';
    cards[i].suit = mark;
    cards[i].rank = (i % 13 + 1);
    cards[i].left = 0;
  }
  scanf("%d", &num_left);
  for (i = 0; i < num_left; i++) {
    fflush(stdin);
    scanf("%c %d", &suit_left, &rank_left);
    for (j = 0; j < 52; j++) {
      if (cards[j].suit == suit_left && cards[j].rank == rank_left) {
        cards[j].left = 1;
      }
    }
  }
  for (i = 0; i < 52; i++) {
    if (cards[i].left == 0) {
      printf("%c %d\n", cards[i].suit, cards[i].rank);
    }
  }
  return 0;
}
