#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, m, i;
  char mark;
  int s[13] = {0}, h[13] = {0}, c[13] = {0}, d[13] = {0};
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> mark >> num;
    num--;
    switch (mark) {
      case 'S':
        s[num] = 1;
        break;
      case 'H':
        h[num] = 1;
        break;
      case 'C':
        c[num] = 1;
        break;
      case 'D':
        d[num] = 1;
        break;
    }
  }
  for (i = 0; i < 13; i++) {
    if (s[num] == 0) cout << "S " << i + 1 << endl;
  }
  for (i = 0; i < 13; i++) {
    if (h[num] == 0) cout << "H " << i + 1 << endl;
  }
  for (i = 0; i < 13; i++) {
    if (c[num] == 0) cout << "C " << i + 1 << endl;
  }
  for (i = 0; i < 13; i++) {
    if (d[num] == 0) cout << "D " << i + 1 << endl;
  }
}
