#include <bits/stdc++.h>
int main(void) {
  int a, n, m[4][13], b = 0, d = 0, k = 0, u = 0, w, e, r[52], f, t = 0, i, p;
  char c, h, v[52];
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%c %d", &c, &n);
    if (c == 'S') {
      m[0][b] = n;
      b++;
    } else if (c == 'H') {
      m[1][d] = n;
      d++;
    } else if (c == 'C') {
      m[2][k] = n;
      k++;
    } else {
      m[3][u] = n;
      u++;
    }
  }
  for (w = 0; w < 4; w++) {
    if (w == 0) {
      h = 'S';
    } else if (w == 1) {
      h = 'H';
    } else if (w == 2) {
      h == 'C';
    } else {
      h == 'D';
    }
    f = 1;
    for (e = 0; e < 13; e++) {
      int j = 0;
      if (m[w][e] == f) {
        j++;
      }
      if (j != 1) {
        v[t] = h;
        r[t] = f;
        t++;
      }
      f++;
    }
  }
  for (p = 0; p < t; p++) {
    printf("%c %d\n", v[p], r[p]);
  }
  return 0;
}
