#include <bits/stdc++.h>
int main(void) {
  unsigned char aulW_Dcards[4][13];
  unsigned char ubW_Dcards;
  unsigned char ubW_Dcards_mark;
  unsigned char ubW_Dcards_rank;
  unsigned char ubW_Ccards_mark_cnt;
  unsigned char ubW_Ccards_rank_cnt;
  scanf("%d", &ubW_Dcards);
  for (ubW_Ccards_mark_cnt = 0; ubW_Ccards_mark_cnt < ubW_Dcards;
       ubW_Ccards_mark_cnt++) {
    scanf("%c %d", &ubW_Dcards_mark, &ubW_Dcards_rank);
    printf("%c %d\n", ubW_Dcards_mark, ubW_Dcards_rank);
    switch (ubW_Dcards_mark) {
      case 'S':
        aulW_Dcards[0][ubW_Dcards_rank - 1] = 1;
        break;
      case 'H':
        aulW_Dcards[1][ubW_Dcards_rank - 1] = 1;
        break;
      case 'C':
        aulW_Dcards[2][ubW_Dcards_rank - 1] = 1;
        break;
      case 'D':
        aulW_Dcards[3][ubW_Dcards_rank - 1] = 1;
        break;
    }
  }
  for (ubW_Ccards_mark_cnt = 0; ubW_Ccards_mark_cnt < 4;
       ubW_Ccards_mark_cnt++) {
    for (ubW_Ccards_rank_cnt = 0; ubW_Ccards_rank_cnt < 13;
         ubW_Ccards_rank_cnt++) {
      if (aulW_Dcards[ubW_Ccards_mark_cnt][ubW_Ccards_rank_cnt] == 0) {
        switch (ubW_Ccards_mark_cnt) {
          case 0:
            printf("S %d\n", ubW_Ccards_rank_cnt + 1);
            break;
          case 1:
            printf("H %d\n", ubW_Ccards_rank_cnt + 1);
            break;
          case 2:
            printf("C %d\n", ubW_Ccards_rank_cnt + 1);
            break;
          case 3:
            printf("D %d\n", ubW_Ccards_rank_cnt + 1);
            break;
        }
      }
    }
  }
  return 0;
}
