#include <bits/stdc++.h>
int main() {
  int n, a = 0, b, i, j;
  char mrk;
  int cards[4][13];
  for (j = 0; j < 4; j++) {
    for (i = 0; i < 13; i++) {
      cards[i][j] = 0;
    }
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c %d", &mrk, &b);
    if (mrk == 'S') {
      a = 0;
    } else if (mrk == 'H') {
      a = 1;
    } else if (mrk == 'C') {
      a = 2;
    } else if (mrk == 'D') {
      a = 3;
    }
    cards[a][b] = 1;
  }
  for (j = 0; j < 4; j++) {
    for (i = 0; i < 13; i++) {
      if (cards[j][i] != 1) {
        switch (j) {
          case 0:
            printf("S %d\n", i);
            break;
          case 1:
            printf("H %d\n", i);
            break;
          case 2:
            printf("C %d\n", i);
            break;
          case 3:
            printf("D %d\n", i);
            break;
          default:
            break;
        }
      }
    }
  }
  return 0;
}
