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