#include <bits/stdc++.h>
int main() {
  int taro = 0, a = 0, b = 0, c = 0, hj[53], d = 0;
  int cards[4][13];
  char egara[53];
  scanf("%d", &taro);
  for (a = 1; a < taro + 1; a++) {
    scanf("%c %d", egara[a], hj[a]);
    if (egara[a] == 'S') {
      cards[0][hj[a]] = 123;
    } else if (egara[a] == 'H') {
      cards[1][hj[a]] = 123;
    } else if (egara[a] == 'C') {
      cards[2][hj[a]] = 123;
    } else if (egara[a] == 'D') {
      cards[3][hj[a]] = 123;
    }
  }
  for (c = 0; c <= 3; c++) {
    for (d = 1; d < 14; d++) {
      if (cards[c][d] != 123) {
        if (c == 0) {
          printf("S %d\n", d);
        } else if (c == 1) {
          printf("H %d\n", d);
        } else if (c == 2) {
          printf("C %d\n", d);
        } else if (c == 3) {
          printf("D %d\n", d);
        }
      }
    }
  }
  return 0;
}
