#include <bits/stdc++.h>
typedef struct {
  char suit;
  char num[13];
} _Card;
int main() {
  int n, i, j;
  int card_num;
  char suit;
  _Card card[4];
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (i == 0) {
        card[i].suit = 'S';
        card[i].num[j] = 1;
      } else if (i == 1) {
        card[i].suit = 'H';
        card[i].num[j] = 1;
      } else if (i == 2) {
        card[i].suit = 'C';
        card[i].num[j] = 1;
      } else if (i == 3) {
        card[i].suit = 'D';
        card[i].num[j] = 1;
      }
    }
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c %d\n", &suit, &card_num);
    printf("suit:%c card_num:%d\n", suit, card_num);
    if (suit == 'S')
      card[0].num[card_num - 1] = 0;
    else if (suit == 'H')
      card[1].num[card_num - 1] = 0;
    else if (suit == 'C')
      card[2].num[card_num - 1] = 0;
    else if (suit == 'D')
      card[3].num[card_num - 1] = 0;
  }
  putchar('\n');
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (card[i].num[j] == 1) printf("%c %d\n", card[i].suit, j + 1);
    }
  }
  return 0;
}
