#include <bits/stdc++.h>
int main() {
  int n, i;
  std::cin >> n;
  int a[n + 1];
  char c[n + 1];
  char S[14] = {0}, H[14] = {0}, C[14] = {0}, D[14] = {0};
  for (i = 0; i < n; i++) {
    std::cin >> c[i] >> a[i];
  }
  for (i = 1; i <= n; i++) {
    if (c[i] == 'S') S[a[i]] = 1;
    if (c[i] == 'H') H[a[i]] = 1;
    if (c[i] == 'C') C[a[i]] = 1;
    if (c[i] == 'D') D[a[i]] = 1;
  }
  for (i = 1; i <= 13; i++) {
    if (S[i] == 0) std::cout << c[i] << " " << i << std::endl;
  }
  for (i = 1; i <= 13; i++) {
    if (H[i] == 0) std::cout << c[i] << " " << i << std::endl;
  }
  for (i = 1; i <= 13; i++) {
    if (C[i] == 0) std::cout << c[i] << "C " << i << std::endl;
  }
  for (i = 1; i <= 13; i++) {
    if (D[i] == 0) std::cout << c[i] << " " << i << std::endl;
  }
  std::cout << std::endl;
  return 0;
}
