#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, S[14] = {}, H[14] = {}, C[14] = {}, D[14] = {}, temp_num;
  char temp_char;
  scanf("%d\n", &N);
  for (int i = 1; i < N; i++) {
    scanf("%c %d ", &temp_char, &temp_num);
    switch (temp_char) {
      case 'S':
        S[temp_num] = temp_num;
        break;
      case 'H':
        H[temp_num] = temp_num;
        break;
      case 'C':
        C[temp_num] = temp_num;
        break;
      case 'D':
        D[temp_num] = temp_num;
        break;
    }
  }
  for (int i = 1; i <= 13; i++) {
    if (S[i] == 0) printf("S %d\n", i);
  }
  for (int i = 1; i <= 13; i++) {
    if (H[i] == 0) printf("H %d\n", i);
  }
  for (int i = 1; i <= 13; i++) {
    if (C[i] == 0) printf("C %d\n", i);
  }
  for (int i = 1; i <= 13; i++) {
    if (D[i] == 0) printf("D %d\n", i);
  }
  return 0;
}
