#include <bits/stdc++.h>
int main(void) {
  char s, suit[] = "SHCD";
  int list[4][13] = {0}, n, r, i, j;
  scanf("%d", &n);
  getchar();
  while (n--) {
    scanf("%c%d", &s, &r);
    switch (s) {
      case 'S':
        list[0][r - 1] = 1;
        break;
      case 'H':
        list[1][r - 1] = 1;
        break;
      case 'C':
        list[2][r - 1] = 1;
        break;
      case 'D':
        list[3][r - 1] = 1;
        break;
      default:
        printf("%d\n", s);
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (list[i][j] == 0) {
        printf("%c %d\n", suit[i], j + 1);
      }
    }
  }
  return 0;
}
