#include <bits/stdc++.h>
using namespace std;
int main() {
  int cards[4][13];
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      cards[i][j];
    }
  }
  int n;
  scanf("%d", n);
  for (int k = 0; k < n; k++) {
    int num;
    char mark;
    cin >> mark >> num;
    if (mark == 'S') {
      cards[0][num] = 1;
    } else if (mark == 'H') {
      cards[1][num] = 1;
    } else if (mark == 'C') {
      cards[2][num] = 1;
    } else if (mark == 'D') {
      cards[3][num] = 1;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      if (cards[i][j] == 0) {
        if (i == 0) {
          printf("S %d\n", j);
        }
        if (i == 1) {
          printf("H %d\n", j);
        }
        if (i == 2) {
          printf("C %d\n", j);
        }
        if (i == 3) {
          printf("D %d\n", j);
        }
      }
    }
  }
  return 0;
}
