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