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