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