#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<pair<char, int>> p;
  vector<pair<char, int>> deck;
  char moji;
  for (int i = 0; i < 4; i++) {
    if (i == 0) {
      moji = 'S';
    } else if (i == 1) {
      moji = 'H';
    } else if (i == 2) {
      moji = 'C';
    } else {
      moji = 'D';
    }
    for (int j = 1; j <= 13; j++) {
      deck.push_back(make_pair(moji, j));
    }
  }
  for (int i = 0; i < n; i++) {
    char x;
    int y;
    cin >> x >> y;
    for (int j = 0; j < deck.size(); j++) {
      if (deck[j].first == x && deck[j].second == y) {
        deck.erase(deck.begin() + j);
      }
    }
  }
  for (int i = 0; i < deck.size(); i++) {
    cout << deck[i].first << " " << deck[i].second << endl;
  }
}
int main() {
  solve();
  return 0;
}
