#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, j;
  pair<char, int> card[53];
  int s[13], h[13], c[13], d[13];
  for (i = 1; i <= 12; i++) {
    s[i] = 1000;
    h[i] = 1000;
    c[i] = 1000;
    d[i] = 1000;
  }
  cin >> n;
  for (i = 1; i <= n; i++) cin >> card[i].first >> card[i].second;
  for (i = 1; i <= n; i++) {
    if (card[i].first == 'S')
      s[card[i].second] = card[i].second;
    else if (card[i].first == 'H')
      h[card[i].second] = card[i].second;
    else if (card[i].first == 'C')
      c[card[i].second] = card[i].second;
    else
      d[card[i].second] = card[i].second;
  }
  int sum = 52;
  sum = sum - n;
  for (i = 1; i <= 12; i++)
    if (s[i] == 1000) cout << "S " << i << endl;
  for (i = 1; i <= 12; i++)
    if (h[i] == 1000) cout << "H " << i << endl;
  for (i = 1; i <= 12; i++)
    if (c[i] == 1000) cout << "C " << i << endl;
  for (i = 1; i <= 12; i++)
    if (d[i] == 1000) cout << "D " << i << endl;
  return 0;
}
