#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool cards[52];
  for (int i = 1; i <= n; i++) {
    string type;
    int cardRank;
    cin >> type >> cardRank;
    if (type == "S")
      cards[cardRank - 1] = true;
    else if (type == "H")
      cards[cardRank + 13 - 1] = true;
    else if (type == "C")
      cards[cardRank + 26 - 1] = true;
    else if (type == "D")
      cards[cardRank + 39 - 1] = true;
  }
  for (int i = 1; i <= 52; i++) {
    if (cards[i - 1] == false) {
      if (i > 39)
        cout << "D " << i - 39 << '\n';
      else if (i > 26)
        cout << "C " << i - 26 << '\n';
      else if (i > 13)
        cout << "H " << i - 13 << '\n';
      else
        cout << "S " << i << '\n';
    }
  }
  return 0;
}
