#include <bits/stdc++.h>
int main() {
  int n, E, i, s, j;
  int a[4][14];
  char e, moji[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s %d", &e, &s);
    if (e == 'S') {
      E = 0;
      moji[0] = 'S';
    } else if (e == 'H') {
      E = 1;
      moji[1] = 'H';
    } else if (e == 'C') {
      E = 2;
      moji[2] = 'C';
    } else if (e == 'D') {
      E = 3;
      moji[3] = 'D';
    }
    a[E][s] = 1;
  }
  for (j = 0; j < 4; j++) {
    for (i = 1; i <= 13; i++) {
      if (a[j][i] != 1) {
        printf("%c %d\n", moji[j], i);
      }
    }
  }
  return 0;
}
