#include <bits/stdc++.h>
int main() {
  int i, j, n, pic, rank, stuck[(4)][(13)];
  char pic_s;
  scanf("%d", &n);
  for (i = 0; i < (13); i++) {
    for (j = 0; j < (4); j++) {
      stuck[j][i] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    scanf("%s %d", &pic_s, &rank);
    switch (pic_s) {
      case 'S':
        pic = 0;
      case 'H':
        pic = 1;
      case 'C':
        pic = 2;
      case 'D':
        pic = 3;
    }
    stuck[pic][rank - 1] = 1;
  }
  for (i = 0; i < (13); i++) {
    for (j = 0; j < (4); j++) {
      if (stuck[j][i] != 1) {
        switch (j) {
          case 0:
            printf("S %d\n", i + 1);
          case 1:
            printf("H %d\n", i + 1);
          case 2:
            printf("C %d\n", i + 1);
          case 3:
            printf("D %d\n", i + 1);
        }
      }
    }
  }
  return 0;
}
