#include <bits/stdc++.h>
int main() {
  int num, n, i, k;
  char c;
  int data[100][14];
  char mark[] = "SHCD";
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    scanf("%c", &c);
    scanf("%d", &n);
    data[c][n]++;
  }
  for (i = 0; i < 4; i++) {
    for (k = 1; k < 14; k++) {
      if (!data[mark[i]][k]) printf("%c %d\n", mark[i], k);
    }
  }
  return 0;
}
