#include <bits/stdc++.h>
using namespace std;
int main() {
  bool Card[53] = {false};
  int n;
  cin >> n;
  cin.ignore();
  int c;
  char s;
  for (int i = 0; i < n; i++) {
    cin >> s >> c;
    cin.ignore();
    switch (s) {
      case 'S':
        Card[c] = true;
        break;
      case 'H':
        Card[c + 13] = true;
        break;
      case 'C':
        Card[c + 13 * 2] = true;
        break;
      case 'D':
        Card[c + 13 * 3] = true;
        break;
      default:
        break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!Card[i]) {
      int suit = i / 13;
      int numb = i % 13;
      switch (suit) {
        case 0:
          cout << "S " << numb << "\n";
          break;
        case 1:
          cout << "H " << numb << "\n";
          break;
        case 2:
          cout << "C " << numb << "\n";
          break;
        case 3:
          cout << "D " << numb << "\n";
          break;
        default:
          break;
      }
    }
  }
  return 0;
}
