#include <bits/stdc++.h>
int main(void) {
  int n, i, a, egara2, cards[4][13] = {};
  char egara;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%c &d", &egara, &a);
    if (egara == 'S') {
      cards[0][a - 1] = 1;
    } else {
      if (egara == 'H') {
        cards[1][a - 1] = 1;
      } else {
        if (egara == 'C') {
          cards[2][a - 1] = 1;
        } else {
          if (egara == 'D')
            ;
          { cards[3][a - 1] = 1; }
        }
      }
    }
  }
  for (egara2 = 0; egara2, 4; egara++) {
    for (a = 0; a < 13; a++) {
      if (cards[egara2][a] != 1) {
        if (egara == 0) {
          printf("S %d\n", a + 1);
        } else {
          if (egara == 1) {
            printf("H %d\n", a + 1);
          } else {
            if (egara == 2) {
              printf("C %d\n", a + 1);
            } else {
              if (egara == 3) {
                printf("D %d\n", a + 1);
              }
            }
          }
        }
      }
    }
  }
  return 0;
}
