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