#include <bits/stdc++.h>
int main() {
  int Cards[4][13], cnt, t_num;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      Cards[i][j] = 1;
    }
  }
  char cha;
  scanf("%d", &cnt);
  rewind(stdin);
  for (int i = 0; i < cnt; i++) {
    scanf("%c %d", &cha, &t_num);
    switch (cha) {
      case 'S':
        Cards[0][t_num - 1] = 0;
        break;
      case 'H':
        Cards[1][t_num - 1] = 0;
        break;
      case 'C':
        Cards[2][t_num - 1] = 0;
        break;
      case 'D':
        Cards[3][t_num - 1] = 0;
        break;
      default:
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (Cards[i][j] == 1) {
        switch (i) {
          case 0:
            printf("S %d\n", j + 1);
            break;
          case 1:
            printf("H %d\n", j + 1);
            break;
          case 2:
            printf("C %d\n", j + 1);
            break;
          case 3:
            printf("D %d\n", j + 1);
            break;
          default:
            break;
        }
      }
    }
  }
  return 0;
}
