#include <bits/stdc++.h>
int main(void) {
  char tag;
  int tagNum;
  int sum, i, j;
  int cardTable[3][13] = {};
  scanf("%d", &sum);
  for (i = 0; i < sum; i++) {
    scanf(" %c %d", &tag, &tagNum);
    switch (tag) {
      case 'S':
        cardTable[0][tagNum]++;
        break;
      case 'H':
        cardTable[1][tagNum]++;
        break;
      case 'C':
        cardTable[2][tagNum]++;
        break;
      case 'D':
        cardTable[3][tagNum]++;
        break;
      default:
        break;
    }
  }
  for (i = 0; i <= 3; i++) {
    for (j = 1; j <= 13; j++) {
      if (cardTable[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;
}
