#include <bits/stdc++.h>
using namespace std;
int main() {
  int card[52] = {0}, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char charactor;
    int number;
    cin >> charactor >> number;
    switch (charactor) {
      case 'S':
        card[number - 1] = 1;
        break;
      case 'H':
        card[1 * 13 + number - 1] = 1;
        break;
      case 'C':
        card[2 * 13 + number - 1] = 1;
        break;
      case 'D':
        card[3 * 13 + number - 1] = 1;
        break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (!card[i]) {
      switch (i / 13) {
        case 0:
          cout << "S ";
          break;
        case 1:
          cout << "H ";
          break;
        case 2:
          cout << "C ";
          break;
        case 3:
          cout << "D ";
          break;
      }
      cout << (i % 13) + 1 << endl;
    }
  }
}
