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