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