#include <bits/stdc++.h>
int main(void) {
  int card[4][13];
  int point;
  scanf("%d", &point);
  char mark;
  int num;
  for (int cnt = 0; cnt < point; cnt++) {
    scanf("%s %d", &mark, &num);
    switch (mark) {
      case 'S':
        card[0][num - 1] = 1;
        break;
      case 'H':
        card[1][num - 1] = 1;
        break;
      case 'C':
        card[2][num - 1] = 1;
        break;
      case 'D':
        card[3][num - 1] = 1;
        break;
    }
  }
  for (int line = 0; line < 4; line++) {
    for (int col = 0; col < 13; col++) {
      if (card[line][col] != 0) {
        switch (line) {
          case 0:
            printf("S %d\n", col + 1);
            break;
          case 1:
            printf("H %d\n", col + 1);
            break;
          case 2:
            printf("C %d\n", col + 1);
            break;
          case 3:
            printf("D %d\n", col + 1);
            break;
        }
      }
    }
  }
  return 0;
}
