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