#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, s = 0, k = 0, h = 0, d = 0, count = 0;
  cin >> n;
  char c;
  int strs[14], strk[14], strh[14], strd[14];
  for (int i = 0; i < n; i++) {
    cin >> c >> x;
    if (c == 'S') {
      strs[s] = x;
      s++;
    }
    if (c == 'H') {
      strh[h] = x;
      h++;
    }
    if (c == 'D') {
      strd[d] = x;
      d++;
    }
    if (c == 'C') {
      strk[k] = x;
      k++;
    }
  }
  for (int i = 1; i < 14; i++) {
    for (int j = 0; j < 14; j++) {
      if (strs[j] == i) count++;
    }
    if (count == 0)
      cout << "S"
           << " " << i << endl;
    count = 0;
  }
  for (int i = 1; i < 14; i++) {
    for (int j = 0; j < 14; j++) {
      if (strh[j] == i) count++;
    }
    if (count == 0)
      cout << "H"
           << " " << i << endl;
    count = 0;
  }
  for (int i = 1; i < 14; i++) {
    for (int j = 0; j < 14; j++) {
      if (strk[j] == i) count++;
    }
    if (count == 0)
      cout << "C"
           << " " << i << endl;
    count = 0;
  }
  for (int i = 1; i < 14; i++) {
    for (int j = 0; j < 14; j++) {
      if (strd[j] == i) count++;
    }
    if (count == 0)
      cout << "D"
           << " " << i << endl;
    count = 0;
  }
  cout << endl;
  return 0;
}
