#include <bits/stdc++.h>
int main(void) {
  int card[4][14] = {false};
  char e[4] = {'S', 'H', 'C', 'D'};
  int n, j, X;
  int i = 0;
  char egara;
  scanf("%d", &n);
  do {
    scanf("%c %d", &egara, &X);
    for (j = 0; j < 4; j++) {
      if (egara == e[j]) {
        card[j][X - 1] = true;
        i--;
        break;
      }
    }
    i++;
  } while (i < n);
  scanf("%c %d", &egara, &X);
  for (j = 0; j < 4; j++) {
    if (egara == e[j]) {
      card[j][X - 1] = true;
      break;
    }
  }
  printf("\n");
  for (j = 0; j < 4; j++) {
    for (i = 0; i < 13; i++) {
      if (!card[j][i]) {
        printf("%c %d\n", e[j], i + 1);
      }
    }
  }
  return 0;
}
