#include <bits/stdc++.h>
using namespace std;
vector<string> searchNonCards(map<char, vector<int>> input_cards);
bool contains(vector<int> v, int num);
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  map<char, vector<int>> cards;
  char mark;
  int num;
  for (int i = 0; i < n; i++) {
    cin >> mark >> num;
    cards.insert(make_pair(mark, num));
  }
  vector<string> non_cards = searchNonCards(cards);
  for (string card : non_cards) {
    cout << card << endl;
  }
  return 0;
}
vector<string> searchNonCards(map<char, vector<int>> input_cards) {
  vector<string> non_cards;
  char marks[4] = {'S', 'H', 'C', 'D'};
  for (char mark : marks) {
    for (int i = 1; i <= 13; i++) {
      if (!contains(input_cards[mark], i)) {
        string buff = {mark};
        non_cards.push_back(buff + " " + to_string(i));
      }
    }
  }
  return non_cards;
}
bool contains(vector<int> v, int num) {
  for (int i : v) {
    if (i == num) {
      return true;
    }
  }
  return false;
}
