#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> s, h, c, d;
  for (int i = 1; i < 14; i++) {
    s.push_back(i);
    h.push_back(i);
    c.push_back(i);
    d.push_back(i);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char mark;
    int num;
    cin >> mark >> num;
    switch (mark) {
      case 'S':
        s[num] = 0;
        break;
      case 'H':
        h[num] = 0;
        break;
      case 'C':
        c[num] = 0;
        break;
      case 'D':
        d[num] = 0;
        break;
    }
  }
  for (int i = 0; i < 13; i++) {
    if (s[i] != 0) {
      cout << "S " << s[i] << '\n';
    }
  }
  for (int i = 0; i < 13; i++) {
    if (h[i] != 0) {
      cout << "H " << h[i] << '\n';
    }
  }
  for (int i = 0; i < 13; i++) {
    if (c[i] != 0) {
      cout << "C " << c[i] << '\n';
    }
  }
  for (int i = 0; i < 13; i++) {
    if (d[i] != 0) {
      cout << "D " << d[i] << '\n';
    }
  }
}
