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