#include <bits/stdc++.h>
int henkan(char pattern) {
  if (pattern == 'S') {
    return 0;
  } else if (pattern == 'H') {
    return 1;
  } else if (pattern == 'C') {
    return 2;
  } else {
    return 3;
  }
}
char moji(int i) {
  if (i == 0) {
    return 'S';
  } else if (i == 1) {
    return 'H';
  } else if (i == 2) {
    return 'C';
  } else {
    return 'D';
  }
}
int main(void) {
  int n;
  scanf("%d", &n);
  char dummy;
  bool checksheet[4][13];
  char pattern;
  int num;
  for (int i = 0; i < n; i++) {
    scanf("%c", &dummy);
    scanf("%c %d", &pattern, &num);
    checksheet[henkan(pattern)][num - 1] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (checksheet[i][j] != true) {
        char a = moji(i);
        printf("%c %d\n", a, j + 1);
      }
    }
  }
  return 0;
}
