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