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