#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int A[4][13];
  for (int i = 0; i < n; i++) {
    string M;
    int S;
    cin >> M >> S;
    if (M == "S") {
      A[0][S - 1] = S;
    } else if (M == "H") {
      A[1][S - 1] = S;
    } else if (M == "D") {
      A[2][S - 1] = S;
    } else if (M == "C") {
      A[3][S - 1] = S;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int K = 0; i < 13; i++) {
      if (A[i][K] == 0) {
        if (i == 0) {
          cout << "S " << K + 1 << endl;
        }
      } else if (A[i][K] == 0) {
        if (i == 1) {
          cout << "H " << K + 1 << endl;
        }
      } else if (A[i][K] == 0) {
        if (i == 2) {
          cout << "D " << K + 1 << endl;
        }
      } else if (A[i][K] == 0) {
        if (i == 3) {
          cout << "C " << K + 1 << endl;
        }
      }
    }
  }
}
