#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  cin >> ws;
  string str;
  vector<string> card;
  while (getline(cin, str)) {
    card.push_back(str);
  }
  vector<string> trump;
  for (int i = 1; i <= 52; i++) {
    string buf;
    if (i <= 13) {
      buf = string("S ") + to_string(i);
    } else if (i <= 26) {
      buf = string("H ") + to_string(i - 13);
    } else if (i <= 39) {
      buf = string("C ") + to_string(i - 26);
    } else {
      buf = string("D ") + to_string(i - 39);
    }
    trump.push_back(buf);
  }
  vector<string>::iterator ti;
  for (int j = 0; j < card.size(); j++) {
    for (ti = trump.begin(); ti != trump.end();) {
      if (card[j] == *ti) {
        trump.erase(ti);
        break;
      } else {
        ti++;
      }
    }
  }
  for (int k = 0; k < trump.size(); k++) {
    cout << trump[k] << endl;
  }
  return 0;
}
