#include <bits/stdc++.h>
int main(int argc, char** argv) {
  int i, j, in_num, total;
  char kind;
  unsigned char ar[4][13] = {{0}};
  scanf("%d", &total);
  for (i = 0; i < total; i++) {
    scanf("%c %d", &kind, &in_num);
    if (kind == 'S') {
      ar[0][in_num - 1] = 1;
    } else if (kind == 'H') {
      ar[1][in_num - 1] = 1;
    } else if (kind == 'C') {
      ar[2][in_num - 1] = 1;
    } else if (kind == 'D') {
      ar[3][in_num - 1] = 1;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (ar[i][j] == 0) {
        char k = '\0';
        switch (i) {
          case 0:
            k = 'S';
            break;
          case 1:
            k = 'H';
            break;
          case 2:
            k = 'C';
            break;
          case 3:
            k = 'D';
            break;
        }
        printf("%c %d\n", k, j + 1);
      }
    }
  }
  return 0;
}
