#include <bits/stdc++.h>
using namespace std;
int suitToIndex(char c) {
  switch (c) {
    default:
    case 'S':
      return 0;
    case 'H':
      return 1;
    case 'C':
      return 2;
    case 'D':
      return 3;
  }
}
char suits[4] = {'S', 'H', 'C', 'D'};
int main() {
  bool found[4][13] = {};
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    char suit;
    int rank;
    cin >> suit >> rank;
    found[suitToIndex(suit)][rank] = true;
  }
  for (int suitIndex = 0; suitIndex < 4; ++suitIndex) {
    for (int rank = 1; rank <= 13; ++rank) {
      if (!found[suitIndex][rank]) {
        cout << suits[suitIndex] << " " << rank << endl;
        ;
      }
    }
  }
}
