#include <bits/stdc++.h>
using namespace std;
int trump[4][13] = {0};
char cin_mark[52];
int cin_rank[52];
int n;
char sub(int i) {
  if (i == 0) return 'S';
  if (i == 1) return 'H';
  if (i == 2) return 'C';
  if (i == 3) return 'D';
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> cin_mark[i];
    cin >> cin_rank[i];
    switch (cin_mark[i]) {
      case 'S':
        trump[0][cin_rank[i] - 1]++;
      case 'H':
        trump[1][cin_rank[i] - 1]++;
      case 'C':
        trump[2][cin_rank[i] - 1]++;
      case 'D':
        trump[3][cin_rank[i] - 1]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (trump[i][j] == 0) {
        printf("%c %d\n", sub(i), j + 1);
      }
    }
  }
  return 0;
}
