#include <bits/stdc++.h>
int main(void) {
  int n, ch, mark, rank;
  int m, r;
  int card[4][13];
  for (m = 0; m < 4; m++) {
    for (r = 0; r < 13; r++) {
      card[m][r] = 0;
    }
  }
  scanf("%d", &n);
  for (m = 0; m < n; m++) {
    ch = getchar();
    switch (ch) {
      case 'S':
        mark = 0;
        break;
      case 'H':
        mark = 1;
        break;
      case 'C':
        mark = 2;
        break;
      case 'D':
        mark = 3;
        break;
    }
    scanf(" %d", &rank);
    card[mark][rank - 1] = 1;
  }
  for (m = 0; m < 4; m++) {
    for (r = 0; r < 13; r++) {
      if (card[m][r] == 0) {
        switch (m) {
          case 0:
            putchar('S');
            break;
          case 1:
            putchar('H');
            break;
          case 2:
            putchar('C');
            break;
          case 3:
            putchar('D');
            break;
        }
      }
      printf(" %d\n", r + 1);
    }
  }
  return 0;
}
