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