#include <bits/stdc++.h>
int main() {
  int n;
  bool cards[4][13];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cards[i][j] = false;
    }
  }
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    char suit;
    int rank;
    std::cin >> suit >> rank;
    switch (suit) {
      case 'S':
        suit = 0;
        break;
      case 'H':
        suit = 1;
        break;
      case 'C':
        suit = 2;
        break;
      case 'D':
        suit = 3;
    }
    cards[suit][rank - 1] = true;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (!cards[i][j]) {
        char suit;
        switch (i) {
          case 0:
            suit = 'S';
            break;
          case 1:
            suit = 'H';
            break;
          case 2:
            suit = 'D';
            break;
          case 3:
            suit = 'C';
        }
        std::cout << suit << ' ' << j + 1 << std::endl;
      }
    }
  }
  return 0;
}
