#include <bits/stdc++.h>
using namespace std;
int makecards(char c, int n) {
  if (c == 'H')
    n += 13;
  else if (c == 'C')
    n += 26;
  else if (c == 'D')
    n += 39;
  return n;
}
char checkcards(int n) {
  int d = n / 13;
  if (d == 0)
    return 'S';
  else if (d == 1)
    return 'H';
  else if (d == 2)
    return 'C';
  else
    return 'D';
}
int reigai(int n) {
  if (n == 0)
    return 13;
  else
    return n;
}
int main() {
  int n;
  cin >> n;
  vector<bool> cards(53);
  cards[0] = true;
  for (int i = 0; i < n; ++i) {
    char c;
    int a;
    cin >> c >> a;
    cards[makecards(c, a)] = true;
  }
  for (int i = 0; i < 53; ++i) {
    if (cards[i] == false) {
      cout << checkcards(i) << " " << reigai(i % 13) << endl;
    }
  }
}
