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