#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, rank;
  bool card[4][13] = {true};
  string suit, suits = "SHCD";
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> suit >> rank;
    card[suits.find(rank)][rank] = false;
  }
  for (int i = 0; i < 4; ++i)
    for (int j = 0; j < 13; ++j)
      if (card[i][j] == true) cout << suits[i] << " " << j << endl;
  return 0;
}
