#include <bits/stdc++.h>
int main(void) {
  int cards[4][13];
  int num;
  int i, j, k;
  char cardChar;
  int cardType;
  int cardInt;
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    scanf("%c %d", cardChar, cardInt);
    switch (cardChar) {
      case 'S':
        cardType = 0;
        break;
      case 'H':
        cardType = 1;
        break;
      case 'C':
        cardType = 2;
        break;
      case 'D':
        cardType = 3;
        break;
      default:
        break;
    }
    cards[cardType][cardInt] = 1;
  }
  for (j = 0; j < 4; j++) {
    for (k = 0; k < 13; k++) {
      if (cards[j][k] == 0) {
        switch (j) {
          case 0:
            cardChar = 'S';
            break;
          case 1:
            cardChar = 'H';
            break;
          case 2:
            cardChar = 'C';
            break;
          case 3:
            cardChar = 'D';
            break;
          default:
            break;
        }
        printf("%c %d", cardChar, k);
      }
    }
  }
  return 0;
}
