#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num;
  string mar;
  int cards[4][14];
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 14; j++) {
      cards[i][j] = 1;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mar >> num;
    if (mar == "S")
      cards[0][num] = 0;
    else if (mar == "H")
      cards[1][num] = 0;
    else if (mar == "C")
      cards[2][num] = 0;
    else if (mar == "D")
      cards[3][num] = 0;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 14; j++) {
      if (cards[i][j] = 1) {
        if (i == 0) cout << "S " << j << endl;
        if (i == 1) cout << "H " << j << endl;
        if (i == 2) cout << "C " << j << endl;
        if (i == 3) cout << "D " << j << endl;
      }
    }
  }
  return 0;
}
