#include <bits/stdc++.h>
int cards(int n) {
  int i, num;
  int S[14], H[14], C[14], D[14];
  char mark;
  for (i = 0; i < n; i++) {
    scanf("%c %d", &mark, &num);
    if (mark == 'S')
      S[num] = 1;
    else if (mark == 'H')
      H[num] = 1;
    else if (mark == 'C')
      C[num] = 1;
    else if (mark == 'D')
      D[num] = 1;
  }
  for (i = 1; i <= 13; i++) {
    if (S[i] != 1) printf("S %d\n", i);
  }
  for (i = 1; i <= 13; i++) {
    if (H[i] != 1) printf("H %d\n", i);
  }
  for (i = 1; i <= 13; i++) {
    if (C[i] != 1) printf("C %d\n", i);
  }
  for (i = 1; i <= 13; i++) {
    if (D[i] != 1) printf("D %d\n", i);
  }
}
int main() {
  int n;
  while (1) {
    scanf("%d", &n);
    if (0 <= n && n <= 52) break;
  }
  cards(n);
  return 0;
}
