#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, n = 0, m = 0, f = 0, i;
  string A;
  cin >> a;
  int S[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  int H[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  int C[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  int D[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  while (n != a) {
    cin >> A;
    cin >> m;
    m += -1;
    if (A == "S") {
      S[m] = 0;
    } else if (A == "H") {
      H[m] = 0;
    } else if (A == "C") {
      C[m] = 0;
    } else if (A == "D") {
      D[m] = 0;
    }
    n++;
  }
  while (f != 12) {
    if (S[f] != 0) {
      cout << "S " << S[f] << endl;
    }
    f++;
  }
  f = 0;
  while (f != 12) {
    if (H[f] != 0) {
      cout << "H " << H[f] << endl;
    }
    f++;
  }
  f = 0;
  while (f != 12) {
    if (C[f] != 0) {
      cout << "C " << C[f] << endl;
    }
    f++;
  }
  f = 0;
  while (f != 12) {
    if (D[f] != 0) {
      cout << "D " << D[f] << endl;
    }
    f++;
  }
  f = 0;
}
