#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  bool cards[4][14];
  int n, x = 0;
  char card;
  int number;
  cin >> n;
  if (n > 0) {
    while (x < n) {
      cin >> card >> number;
      if (card == 'S') {
        cards[0][number] = true;
      }
      if (card == 'H') {
        cards[1][number] = true;
      }
      if (card == 'C') {
        cards[2][number] = true;
      }
      if (card == 'D') {
        cards[3][number] = true;
      }
      x++;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 14; j++) {
      if (cards[i][j] == false) {
        if (i == 0) cout << "S " << j << '\n';
        if (i == 1) cout << "H " << j << '\n';
        if (i == 2) cout << "C " << j << '\n';
        if (i == 3) cout << "D " << j << '\n';
      }
    }
  }
  return 0;
}
