#include <bits/stdc++.h>
int main(void) {
  bool card[4][13];
  int n, card_num;
  char sign;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      card[i][j] = false;
    }
  }
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %c %d", &sign, &card_num);
    switch (sign) {
      case 'S':
        card[0][card_num - 1] = true;
        break;
      case 'H':
        card[1][card_num - 1] = true;
        break;
      case 'C':
        card[2][card_num - 1] = true;
        break;
      case 'D':
        card[3][card_num - 1] = true;
        break;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (card[i][j] == false) {
        if (i == 0) {
          printf("S %d\n", j + 1);
        } else if (i == 1) {
          printf("H %d\n", j + 1);
        } else if (i == 2) {
          printf("C %d\n", j + 1);
        } else if (i == 3) {
          printf("D %d\n", j + 1);
        }
      }
    }
  }
  return 0;
}
