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