#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (int(i) = 0; (i) < (n); (i)++) {
    string s;
    int j;
    cin >> s >> j;
    if (s == "S") {
      v.push_back(make_pair(0, j));
    } else if (s == "H") {
      v.push_back(make_pair(1, j));
    } else if (s == "C") {
      v.push_back(make_pair(2, j));
    } else {
      v.push_back(make_pair(3, j));
    }
  }
  sort(v.begin(), v.end());
  vector<pair<int, int> > w;
  for (int(i) = 0; (i) < (4); (i)++) {
    for (int(j) = (1); (j) < (13); (j)++) {
      if (!binary_search(v.begin(), v.end(), make_pair(i, j))) {
        w.push_back(make_pair(i, j));
      }
    }
  }
  for (int(i) = 0; (i) < (w.size()); (i)++) {
    switch (w[i].first) {
      case 0:
        cout << "S " << w[i].second << endl;
        break;
      case 1:
        cout << "H " << w[i].second << endl;
        break;
      case 2:
        cout << "C " << w[i].second << endl;
        break;
      case 3:
        cout << "D " << w[i].second << endl;
        break;
      default:
        break;
    }
  }
  return 0;
}
