#include <bits/stdc++.h>
using namespace std;
int main() {
  int card[4][13] = {};
  int n, num;
  char m;
  cin >> n;
  for (int k = 0; k < n; k++) {
    cin >> m >> num;
    if (m == 'S') {
      card[0][num - 1] = num;
    }
    if (m == 'H') {
      card[1][num - 1] = num;
    }
    if (m == 'C') {
      card[2][num - 1] = num;
    }
    if (m == 'D') {
      card[3][num - 1] = num;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (card[i][j] != 0) {
        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;
        }
      }
    }
  }
}
