#include <bits/stdc++.h>
const int CARDS = 13;
const std::string CARD_SPADE = "S";
const std::string CARD_CLUB = "C";
const std::string CARD_HEART = "H";
const std::string CARD_DIAMOND = "D";
class Card {
 private:
  std::string handle;
  int number;
  bool check;

 public:
  Card() {
    this->handle = "";
    this->number = 0;
    check = false;
  }
  Card(const std::string &handle, int number) {
    this->handle = handle;
    this->number = number;
    check = false;
  }
  void set_check(const std::string &handle, int number) {
    if (this->handle == handle && this->number == number) {
      check = true;
    }
  }
  bool get_check() { return check; }
  std::string to_string() { return handle + " " + std::to_string(number); }
};
int main(int argc, char *argv[]) {
  std::array<Card, CARDS * 4> cards;
  std::string handles[] = {CARD_SPADE, CARD_HEART, CARD_CLUB, CARD_DIAMOND};
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < CARDS; j++) {
      cards[(j + 1) + (i * CARDS) - 1] = Card(handles[i], j + 1);
    }
  }
  int cardCount;
  std::string handle;
  int number;
  std::cin >> cardCount;
  for (int i = 0; i < cardCount; i++) {
    std::cin >> handle >> number;
    for (int j = 0; j < CARDS * 4; j++) {
      cards[j].set_check(handle, number);
    }
  }
  for (Card c : cards) {
    if (c.get_check()) {
      std::cout << c.to_string() << std::endl;
    }
  }
  return 0;
}
