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