#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using namespace std::placeholders;
using ll = long long;
const int INF = 1e9 + 7;
const ll INF_LL = 1e18 + 7;
template <class T>
inline bool chmin(T& var, T x) {
  if (var > x) {
    var = x;
    return true;
  } else
    return false;
}
template <class T>
inline bool chmax(T& var, T x) {
  if (var < x) {
    var = x;
    return true;
  } else
    return false;
}
class MyScanner {
 public:
  template <typename T>
  void input_integer(T& var) {
    var = 0;
    T sign = 1;
    int cc = getchar_unlocked();
    for (; cc < '0' || '9' < cc; cc = getchar_unlocked())
      if (cc == '-') sign = -1;
    for (; '0' <= cc && cc <= '9'; cc = getchar_unlocked())
      var = (var << 3) + (var << 1) + cc - '0';
    var = var * sign;
  }
  inline int c() { return getchar_unlocked(); }
  inline MyScanner& operator>>(char& var) {
    var = c();
    return *this;
  }
  inline MyScanner& operator>>(int& var) {
    input_integer<int>(var);
    return *this;
  }
  inline MyScanner& operator>>(ll& var) {
    input_integer<ll>(var);
    return *this;
  }
  inline MyScanner& operator>>(string& var) {
    int cc = getchar_unlocked();
    for (; !isvisiblechar(cc); cc = getchar_unlocked())
      ;
    for (; isvisiblechar(cc); cc = getchar_unlocked()) var.push_back(cc);
    return *this;
  }
  inline operator char() {
    char n;
    *this >> n;
    return n;
  }
  inline operator int() {
    int n;
    *this >> n;
    return n;
  }
  inline operator ll() {
    ll n;
    *this >> n;
    return n;
  }

 private:
  inline int isvisiblechar(int c) { return 0x21 <= c && c <= 0x7E; }
};
class MyPrinter {
 public:
  template <typename T>
  void output_integer(T var) {
    if (var == 0) {
      putchar_unlocked('0');
      return;
    }
    if (var < 0) putchar_unlocked('-'), var = -var;
    char stack[32];
    int stack_p = 0;
    while (var) stack[stack_p++] = '0' + (var % 10), var /= 10;
    while (stack_p) putchar_unlocked(stack[--stack_p]);
  }
  inline MyPrinter& operator<<(char c) {
    putchar_unlocked(c);
    return *this;
  }
  inline MyPrinter& operator<<(int var) {
    output_integer<int>(var);
    return *this;
  }
  inline MyPrinter& operator<<(ll var) {
    output_integer<ll>(var);
    return *this;
  }
  inline MyPrinter& operator<<(char* str_p) {
    while (*str_p) putchar_unlocked(*(str_p++));
    return *this;
  }
  inline MyPrinter& operator<<(const char* str_p) {
    while (*str_p) putchar_unlocked(*(str_p++));
    return *this;
  }
  inline MyPrinter& operator<<(const string& str) {
    const char* p = str.c_str();
    const char* l = p + str.size();
    while (p < l) putchar_unlocked(*p++);
    return *this;
  }
};
MyScanner IN;
MyPrinter OUT;
int main() {
  map<string, vector<bool>> m{
      {"S", vector<bool>(13, false)},
      {"H", vector<bool>(13, false)},
      {"C", vector<bool>(13, false)},
      {"D", vector<bool>(13, false)},
  };
  int n = IN;
  for (int __name = 0, __name__until = (n); __name < __name__until; __name++) {
    string s;
    IN >> s;
    m[s][int(IN) - 1] = true;
  }
  for (auto&& p : m) {
    for (int i = 0, i__until = (13); i < i__until; i++)
      if (not p.second[i]) OUT << p.first << " " << (i + 1) << "\n";
  }
}
