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