#include <bits/stdc++.h>
using namespace std;
char X;
int anko;
int main() {
  int A = 0;
  bool C[4][13];
  cin >> A;
  for (int i = 0; i < A; i++) {
    cin >> X >> anko;
    if (X == 'S') {
      C[0][anko] = 1;
    }
    if (X == 'H') {
      C[1][anko] = 1;
    }
    if (X == 'C') {
      C[2][anko] = 1;
    }
    if (X == 'D') {
      C[3][anko] = 1;
    }
  }
  for (int L = 0; L < 4; L++) {
    for (int K = 0; K <= 13; K++) {
      if (C[L][K] != 1) {
        if (L == 0) {
          if (K != 0) {
            cout << "S " << K << endl;
          }
        }
        if (L == 1) {
          if (K != 0) {
            cout << "H " << K << endl;
          }
        }
        if (L == 2) {
          if (K != 0) {
            cout << "C " << K << endl;
          }
        }
        if (L == 3) {
          if (K != 0) {
            cout << "D " << K << endl;
          }
        }
      }
    }
  }
}
