#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 1, N;
  int nS = 13, nH = 13, nC = 13, nD = 13;
  int numS, numH, numC, numD;
  char M;
  queue<int> S;
  queue<int> H;
  queue<int> C;
  queue<int> D;
  for (int i = 0; i < 13; i++) {
    S.push(cnt);
    H.push(cnt);
    C.push(cnt);
    D.push(cnt);
    cnt++;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> M >> N;
    if (M == 'S') {
      for (int j = 1; j <= 13; j++) {
        int huga = S.front();
        S.pop();
        if (huga != N) {
          S.push(j);
        }
        if (huga == N) {
          nS--;
          break;
        }
      }
    }
    if (M == 'H') {
      for (int j = 1; j <= 13; j++) {
        int huga = H.front();
        H.pop();
        if (huga != N) {
          H.push(j);
        }
        if (huga == N) {
          nH--;
          break;
        }
      }
    }
    if (M == 'C') {
      for (int j = 1; j <= 13; j++) {
        int huga = C.front();
        C.pop();
        if (huga != N) {
          C.push(j);
        }
        if (huga == N) {
          nC--;
          break;
        }
      }
    }
    if (M == 'D') {
      for (int j = 1; j <= 13; j++) {
        int huga = D.front();
        D.pop();
        if (huga != N) {
          D.push(j);
        }
        if (huga == N) {
          nD--;
          break;
        }
      }
    }
    for (int j = 0; j < nS; j++) {
      numS = S.front();
      cout << "S"
           << " " << numS << endl;
      S.pop();
    }
    for (int j = 0; j < nH; j++) {
      numH = H.front();
      cout << "H"
           << " " << numH << endl;
      H.pop();
    }
    for (int j = 0; j < nC; j++) {
      numC = C.front();
      cout << "C"
           << " " << numC << endl;
      C.pop();
    }
    for (int j = 0; j < nD; j++) {
      numD = D.front();
      cout << "D"
           << " " << numD << endl;
      D.pop();
    }
  }
  return 0;
}
