#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  bool cards[4][13];
  int n, rank;
  char suit;
  char suits[5] = "SHCD";
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cards[i][j] = 0;
    }
  }
  cin >> n;
  for (int k = 0; k < n; k++) {
    cin >> suit >> rank;
    if (suit == 'S') cards[0][rank] = 1;
    if (suit == 'H') cards[1][rank] = 1;
    if (suit == 'C') cards[2][rank] = 1;
    if (suit == 'D') cards[3][rank] = 1;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (cards[i][j] == 0) cout << suits[i] << " " << cards[i][j];
    }
  }
  return 0;
}
