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