#include <bits/stdc++.h>
int main(void) {
  int sumCard = 0, storeCardNum = 0, matrixCard[3][12] = {};
  int i = 0, j = 0;
  char cardName;
  scanf("%d", &sumCard);
  for (i = 0; i < sumCard; i = i + 1) {
    scanf("%c %d", &cardName, &storeCardNum);
    switch (cardName) {
      case 'S':
        matrixCard[0][storeCardNum - 1] = 1;
        break;
      case 'H':
        matrixCard[1][storeCardNum - 1] = 1;
        break;
      case 'C':
        matrixCard[2][storeCardNum - 1] = 1;
        break;
      case 'D':
        matrixCard[3][storeCardNum - 1] = 1;
        break;
      default:
        break;
    }
  }
  for (i = 0; i < 4; i = i + 1) {
    for (j = 0; j < 14; i = i + 1) {
      if (matrixCard[i][j] == 0) {
        switch (i) {
          case 0:
            printf("S %d\n", j);
            break;
          case 1:
            printf("H %d\n", j);
            break;
          case 2:
            printf("C %d\n", j);
            break;
          case 3:
            printf("D %d\n", j);
            break;
          default:
            break;
        }
      }
    }
  }
  return 0;
}
