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