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