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