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