#include <bits/stdc++.h>
int main(void) {
  char trumpMark;
  char dummy;
  int trump[4][13];
  int cards;
  int number;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      trump[i][j] = 0;
    }
  }
  scanf("%d", &cards);
  for (int i = 0; i < cards; i++) {
    scanf("%*c%c", &trumpMark);
    scanf("%d", &number);
    switch (trumpMark) {
      case 'S':
        trump[0][number] = number;
        break;
      case 'H':
        trump[1][number] = number;
        break;
      case 'C':
        trump[2][number] = number;
        break;
      case 'D':
        trump[3][number] = number;
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (trump[i][j + 1] == 0) {
        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;
        }
      }
    }
  }
  return 0;
}
