#include <bits/stdc++.h>
char trump[] = {'S', 'H', 'C', 'D'};
int toNum(char c) {
  int ret;
  switch (c) {
    case 'S':
      ret = 0;
      break;
    case 'H':
      ret = 1;
      break;
    case 'C':
      ret = 2;
      break;
    case 'D':
      ret = 3;
      break;
    default:
      ret = -1;
      break;
  }
  return ret;
}
char toTrump(int n) { return trump[n]; }
void show(unsigned int *data, int n) {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 12; j >= 0; j--) {
      printf("%d", (data[i] & (1 << j)) != 0 ? 1 : 0);
    }
    putchar('\n');
  }
  return;
}
int main(void) {
  int i, j, n;
  int lank, mark;
  char str[10];
  char *t, *l;
  unsigned int data[4];
  scanf("%d%*c", &n);
  for (i = 0; i < n; i++) {
    fgets(str, 10, stdin);
    t = strtok(str, " \n");
    mark = toNum(t[0]);
    l = strtok(NULL, " \n");
    lank = atoi(l);
    data[mark] |= 1 << (lank - 1);
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if ((data[i] & 1 << j) == 0) {
        printf("%c %d\n", toTrump(i), j + 1);
      }
    }
  }
  return 0;
}
