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