#include <bits/stdc++.h>
using namespace std;
int main() {
  int countS = 0, countH = 0, countC = 0, countD = 0;
  char s, h, c, d;
  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};
  vector<char> S, H, C, D;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    char m;
    int l;
    cin >> m;
    cin >> l;
    if (m == 'S') {
      S.push_back(l);
      countS++;
    } else if (m == 'H') {
      H.push_back(l);
      countH++;
    } else if (m == 'C') {
      C.push_back(l);
      countC++;
    } else if (m == 'D') {
      D.push_back(l);
      countD++;
    }
  }
  sort(S.begin(), S.end());
  sort(H.begin(), H.end());
  sort(C.begin(), C.end());
  sort(D.begin(), D.end());
  if (S.size() != 13)
    for (int i = countS; i <= 13; ++i) {
      S.push_back(0);
    }
  if (H.size() != 13)
    for (int i = countH; i <= 13; ++i) {
      H.push_back(0);
    }
  if (C.size() != 13)
    for (int i = countC; i <= 13; ++i) {
      C.push_back(0);
    }
  if (D.size() != 13)
    for (int i = countD; i <= 13; ++i) {
      D.push_back(0);
    }
  bool flagS = false;
  bool flagH = false;
  bool flagC = false;
  bool flagD = false;
  for (int i = 0; i < 13; ++i) {
    flagS = false;
    for (int j = 0; j < 13; ++j) {
      if (S_[i] == S[j]) flagS = true;
      break;
    }
    if (flagS == false) cout << "S " << S_[i] << endl;
  }
  for (int i = 0; i < 13; ++i) {
    flagH = false;
    for (int j = 0; j < 13; ++j) {
      if (H_[i] == H[j]) flagH = true;
      break;
    }
    if (flagH == false) cout << "H " << H_[i] << endl;
  }
  for (int i = 0; i < 13; ++i) {
    flagC = false;
    for (int j = 0; j < 13; ++j) {
      if (C_[i] == C[j]) flagC = true;
      break;
    }
    if (flagC == false) cout << "C " << C_[i] << endl;
  }
  for (int i = 0; i < 13; ++i) {
    flagD = false;
    for (int j = 0; j < 13; ++j) {
      if (D_[i] == D[j]) flagD = true;
      break;
    }
    if (flagD == false) cout << "D " << D_[i] << endl;
  }
  return 0;
}
