#include <bits/stdc++.h>
int main(int argv, char *argc[]) {
  int count, x, y, inputn;
  char inputc;
  char stotal[13], htotal[13], ctotal[13], dtotal[13];
  scanf("%d\n", &count);
  for (x = 0; count > x; x++) {
    scanf("%c %d\n", &inputc, &inputn);
    switch (inputc) {
      case 'S':
        stotal[inputn - 1] = 1;
        break;
      case 'H':
        htotal[inputn - 1] = 1;
        break;
      case 'C':
        ctotal[inputn - 1] = 1;
        break;
      case 'D':
        dtotal[inputn - 1] = 1;
        break;
    }
  }
  for (x = 0; 4 > x; x++) {
    for (y = 0; 13 > y; y++) {
      switch (x) {
        case 0:
          if (0 == stotal[y]) {
            printf("S %d\n", y + 1);
          }
          break;
        case 1:
          if (0 == htotal[y]) {
            printf("H %d\n", y + 1);
          }
          break;
        case 2:
          if (0 == ctotal[y]) {
            printf("C %d\n", y + 1);
          }
          break;
        case 3:
          if (0 == dtotal[y]) {
            printf("D %d\n", y + 1);
          }
          break;
      }
    }
  }
  return 0;
}
