#include <bits/stdc++.h>
struct card_tag {
  char mark;
  int number;
};
int main(void) {
  int count, i, j, k;
  char mark[] = {'D', 'H', 'S', 'C'};
  scanf("%d", &count);
  struct card_tag data[count];
  for (i = 0; i < count; i++) {
    scanf(" %c %d", &data[i].mark, &data[i].number);
  }
  for (i = 0; i < 13; i++) {
    for (j = 0; j < 4; j++) {
      int check = 0;
      for (k = 0; k < count; k++) {
        if (data[k].mark == mark[j] && data[k].number == i) {
          check++;
        }
      }
      if (check == 0) {
        printf("%c %d\n", mark[j], i);
      }
    }
  }
  return 0;
}
