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