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