#include <bits/stdc++.h>
int main(void) {
  int n, a, b;
  char x;
  int S[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int H[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int C[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int D[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  scanf("%d", &n);
  for (a = 1; a <= n; a++) {
    scanf("%c %d", &x, &b);
    if (x == 'S') {
      S[b] = 1;
    } else if (x == 'H') {
      H[b] = 1;
    } else if (x == 'C') {
      C[b] = 1;
    } else if (x == 'D') {
      D[b] = 1;
    }
    printf("%c", x);
  }
  for (a = 1; a <= 13; a++) {
    if (S[a] == 0) {
      printf("S %d\n", a);
    }
  }
  for (a = 1; a <= 13; a++) {
    if (H[a] == 0) {
      printf("H %d\n", a);
    }
  }
  for (a = 1; a <= 13; a++) {
    if (C[a] == 0) {
      printf("C %d\n", a);
    }
  }
  for (a = 1; a <= 13; a++) {
    if (D[a] == 0) {
      printf("D %d\n", a);
    }
  }
  return 0;
}
