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