#include <bits/stdc++.h>
int main(void) {
  int n, i, j, a, cards[4][13];
  char egara, egara2[5] = "SHCD";
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c", &egara);
    scanf("%c %d", &egara, &a);
    for (j = 0; j < 4; j++) {
      if (egara2[j] == egara) {
        cards[j][a - 1] = 1;
      }
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (cards[i][j] == 1) {
        printf("%c %d\n", egara2[i], j + 1);
      }
    }
  }
  return 0;
}
