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