#include <bits/stdc++.h>
int main() {
  bool card[4][13] = {0};
  int cardn[52], n;
  char mark[52];
  std::cin >> n;
  for (int i = 0; i < n; i++) std::cin >> mark[i] >> cardn[i];
  for (int i = 0; i < n; i++) {
    if (mark[i] == 'S') card[0][(cardn[i]) - 1] = 1;
    if (mark[i] == 'H') card[1][(cardn[i]) - 1] = 1;
    if (mark[i] == 'C') card[2][(cardn[i]) - 1] = 1;
    if (mark[i] == 'D') card[3][(cardn[i]) - 1] = 1;
  }
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 13; j++) {
      if (card[i][j] == 0) {
        if (i == 0) std::cout << 'S' << " " << (j + 1) % 13 + 1 << std::endl;
        if (i == 1) std::cout << 'H' << " " << (j + 1) % 13 + 1 << std::endl;
        if (i == 2) std::cout << 'C' << " " << (j + 1) % 13 + 1 << std::endl;
        if (i == 3) std::cout << 'D' << " " << (j + 1) % 13 + 1 << std::endl;
      }
    }
  return 0;
}
