#include <bits/stdc++.h>
using namespace std;
int suit_str_to_int(char s[1]) {
  int suit;
  if (s[0] == 'S') {
    suit = 1;
  } else if (s[0] == 'H') {
    suit = 2;
  } else if (s[0] == 'C') {
    suit = 3;
  } else if (s[0] == 'D') {
    suit = 4;
  } else {
    cout << "You got an unexpected character.";
  }
  return suit;
}
char suit_int_to_str(int i) {
  char s[1];
  if (i == 1) {
    s[0] = {'S'};
  } else if (i == 2) {
    s[0] = {'H'};
  } else if (i == 3) {
    s[0] = {'C'};
  } else if (i == 4) {
    s[0] = {'D'};
  } else {
    cout << "You got an unexpected number";
  }
  return s[0];
}
int main() {
  int input_cards[4][13] = {0}, output_cards[4][13], l, n, suit;
  char str[0];
  cin >> l;
  for (int i = 0; i < l; ++i) {
    cin >> str[0] >> n;
    suit = suit_str_to_int(str);
    input_cards[suit][n] = 1;
  }
  for (int j = 1; j < 5; ++j) {
    for (int k = 1; k < 14; ++k) {
      if (input_cards[j][k] == 1) {
        continue;
      } else {
        cout << suit_int_to_str(j) << " " << k << endl;
      }
    }
  }
  return 0;
}
