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