#include <bits/stdc++.h>
int main() {
  const int rankNum = 52;
  const int suitNum = 4;
  int n;
  std::cin >> n;
  bool isRank[suitNum][rankNum] = {};
  char suitbuf;
  int rankbuf;
  for (int i = 0; i < n; ++i) {
    std::cin >> suitbuf >> rankbuf;
    switch (suitbuf) {
      case 'S':
        isRank[0][rankbuf] = true;
        break;
      case 'H':
        isRank[1][rankbuf] = true;
        break;
      case 'C':
        isRank[2][rankbuf] = true;
        break;
      case 'D':
        isRank[3][rankbuf] = true;
        break;
    }
  }
  for (int i = 0; i < suitNum; ++i) {
    for (int j = 0; j < rankNum; ++j) {
      if (!isRank[i][j]) {
        switch (i) {
          case 0:
            std::cout << "S " << j << std::endl;
            break;
          case 1:
            std::cout << "H " << j << std::endl;
            break;
          case 2:
            std::cout << "C " << j << std::endl;
            break;
          case 3:
            std::cout << "D " << j << std::endl;
            break;
        }
      }
    }
  }
  return 0;
}
