#include <bits/stdc++.h>
int main(void) {
  int havecard = 0;
  bool card[4][13];
  int i;
  int j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      card[i][j] = 0;
    }
  }
  char mark;
  int number;
  scanf("%d", &havecard);
  for (i = 0; i <= havecard + havecard - 1; i++) {
    scanf("%c %d", &mark, &number);
    if (mark == 'S') {
      card[0][number - 1] = 1;
    }
    if (mark == 'H') {
      card[1][number - 1] = 1;
    }
    if (mark == 'D') {
      card[2][number - 1] = 1;
    }
    if (mark == 'C') {
      card[3][number - 1] = 1;
    }
  }
  for (i = 0; i <= 3; i++) {
    if (i == 0) {
      for (number = 0; number < 13; number++) {
        if (card[0][number] == 0) {
          printf("%c %d\n", 'S', number + 1);
        }
      }
    }
    if (i == 1) {
      for (number = 0; number < 13; number++) {
        if (card[1][number] == 0) {
          printf("%c %d\n", 'H', number + 1);
        }
      }
    }
    if (i == 2) {
      for (number = 0; number < 13; number++) {
        if (card[2][number] == 0) {
          printf("%c %d\n", 68, number + 1);
        }
      }
    }
    if (i == 3) {
      for (number = 0; number < 13; number++) {
        if (card[3][number] == 0) {
          printf("%c %d\n", 67, number + 1);
        }
      }
    }
  }
  return 0;
}
