#include <bits/stdc++.h>
int main(void) {
  int card_num, number, count;
  int card_check[4][14] = {};
  int typ_cou, num_cou;
  char card_typ;
  scanf("%d", &number);
  count = 0;
  while (count < number) {
    scanf("%c %d", &card_typ, &card_num);
    if (card_typ == 'S') {
      card_check[0][card_num] = card_num;
    } else if (card_typ == 'H') {
      card_check[1][card_num] = card_num;
    } else if (card_typ == 'C') {
      card_check[2][card_num] = card_num;
    } else if (card_typ == 'D') {
      card_check[3][card_num] = card_num;
    }
    count++;
  }
  for (typ_cou = 0; typ_cou < 4; typ_cou++) {
    for (num_cou = 1; num_cou < 14; num_cou++) {
      if (card_check[typ_cou][num_cou] != num_cou) {
        if (typ_cou == 0) {
          printf("S %d\n", num_cou);
        } else if (typ_cou == 1) {
          printf("H %d\n", num_cou);
        } else if (typ_cou == 2) {
          printf("C %d\n", num_cou);
        } else if (typ_cou == 3) {
          printf("D %d\n", num_cou);
        }
      }
    }
  }
  return 0;
}
