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