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