#include <bits/stdc++.h>
int main() {
  int n;
  int i, j;
  const char m[4] = {'S', 'H', 'C', 'D'};
  int nmb[52];
  char mn[52];
  int check[][13] = {0};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c %d", &mn[i], &nmb[i]);
    for (j = 0; j < 4; j++) {
      if (mn[i] == m[j]) check[j][nmb[i] - 1] = 1;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (!(check[i][j])) printf("%c %d\n", &mn[i], &j + 1);
    }
  }
  return 0;
}
