#include <bits/stdc++.h>
int suit2index(char suit) {
  switch (suit) {
    case 'S':
      return 0;
    case 'H':
      return 1;
    case 'C':
      return 2;
    case 'D':
      return 3;
  }
  return -1;
}
char index2suit(int num) {
  switch (num) {
    case 0:
      return 'S';
    case 1:
      return 'H';
    case 2:
      return 'C';
    case 3:
      return 'D';
  }
  return '\0';
}
int main() {
  int n, num, cards[4][13];
  char suit;
  for (int s = 0; s < 4; ++s) {
    for (int i = 0; i < 13; ++i) {
      cards[s][i] = 0;
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %c %d", &suit, &num);
    cards[suit2index(suit)][num] = 1;
  }
  for (int s = 0; s < 4; ++s) {
    for (int i = 0; i < 13; ++i) {
      if (cards[s][i] == 0) {
        printf("%c %d\n", index2suit(s), i);
      }
    }
  }
  return 0;
}
