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