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