#include <bits/stdc++.h>
int main() {
  bool cards[4][14];
  int n, rank;
  char suit;
  for (int s = 0; s < 4; s++)
    for (int r = 1; r <= 13; r++) cards[s][r] = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%c%d", &suit, &rank);
    if (suit == 'S') cards[0][rank] = 1;
    if (suit == 'H') cards[1][rank] = 1;
    if (suit == 'C') cards[2][rank] = 1;
    if (suit == 'D') cards[3][rank] = 1;
  }
  for (int s = 0; s < 4; s++) {
    for (int r = 1; r <= 13; r++) {
      if (cards[s][r]) continue;
      if (s == 0) suit = 'S';
      if (s == 1) suit = 'H';
      if (s == 2) suit = 'C';
      if (s == 3) suit = 'D';
      printf("%c %d", suit, r);
    }
  }
  return 0;
}
