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