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