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