#include <bits/stdc++.h>
using namespace std;
bool a[4][13];
string S = "SHCD";
signed main() {
  map<char, int> M;
  M['H'] = 1;
  M['C'] = 2;
  M['D'] = 3;
  int b;
  cin >> b;
  for (int c = 0; c < b; c++) {
    char d;
    cin >> d;
    int e;
    cin >> e;
    a[M[d]][e - 1] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (a[i][j]) {
        printf("%c %d\n", S[i], j + 1);
      }
    }
  }
}
