#include <bits/stdc++.h>
int toindex(int c) {
  if (c == 'S') return 0;
  if (c == 'H') return 1;
  if (c == 'C') return 2;
  return 3;
}
int main(void) {
  int i, j, n, c, num, card[4][14];
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 14; j++) {
      card[i][j] = 0;
    }
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &c, &num);
    card[toindex(c)][num] = 1;
  }
  for (j = 0; j < 4; j++) {
    for (i = 0; i < 4; i++) {
      if (card[toindex(c)][num] == 0) {
        printf("%c %d\n", toindex(c), num);
      }
    }
  }
  return 0;
}
