#include <bits/stdc++.h>
int main() {
  int n, i, j;
  char c;
  int checked;
  int card[4][13] = {0};
  char s[4] = {'S', 'H', 'C', 'D'};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c %d", &c, &checked);
    for (j = 0; j < 4; j++) {
      if (s[j] == toupper(c)) {
        card[j][checked - 1] = 1;
      }
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 1; j <= 13; j++) {
      if (card[i][j - 1] != 1) printf("%c %d\n", s[i], j);
    }
  }
  return 0;
}
