#include <bits/stdc++.h>
int main() {
  char buffer[6];
  int i, j, n, rank, suit_int;
  char suit_char;
  int cards[4][13] = {0};
  fgets(buffer, 3, stdin);
  sscanf(buffer, "%d", &n);
  for (i = 0; i < n; i++) {
    fgets(buffer, 6, stdin);
    sscanf(buffer, "%c %d", &suit_char, &rank);
    switch (suit_char) {
      case 'S':
        suit_int = 0;
        break;
      case 'H':
        suit_int = 1;
        break;
      case 'C':
        suit_int = 2;
        break;
      case 'D':
        suit_int = 3;
        break;
      default:
        fprintf(stderr, "undefined");
        return (1);
    }
    cards[suit_int][rank - 1] = 1;
  }
  for (i = 0; i < 4; i++) {
    suit_int = i;
    switch (suit_int) {
      case 0:
        suit_char = 'S';
        break;
      case 1:
        suit_char = 'H';
        break;
      case 2:
        suit_char = 'C';
        break;
      case 3:
        suit_char = 'D';
        break;
      default:
        fprintf(stderr, "undefined");
        return (1);
    }
    for (j = 0; j < 13; j++) {
      if (!cards[suit_int][j]) {
        printf("%c %d\n", suit_char, j + 1);
      }
    }
  }
}
