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