#include <bits/stdc++.h>
int main() {
  int i, k, m, l, j, h, n;
  int card[5][14];
  int number;
  char mark;
  scanf("%d", &n);
  for (i = 1; i <= 4; i++) {
    for (k = 1; k <= 13; k++) {
      card[i][k] = 0;
    }
  }
  for (j = 1; j <= n + 47; j++) {
    scanf("%c %d", &mark, &number);
    if (mark == 'S') {
      card[1][number] = 1;
    } else if (mark == 'H') {
      card[2][number] = 1;
    } else if (mark == 'C') {
      card[3][number] = 1;
    } else if (mark == 'D') {
      card[4][number] = 1;
    }
  }
  for (m = 1; m <= 4; m++) {
    for (l = 1; l <= 13; l++) {
      if (m == 1 && card[m][l] == 0) {
        printf("S %d\n", l);
      } else if (m == 2 && card[m][l] == 0) {
        printf("H %d\n", l);
      } else if (m == 3 && card[m][l] == 0) {
        printf("C %d\n", l);
      } else if (m == 4 && card[m][l] == 0) {
        printf("D %d\n", l);
      }
    }
  }
  return 0;
}
