#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, N;
  char K;
  cin >> n;
  bool cards[4][13];
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      cards[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> K >> N;
    if (K == 'S') {
      cards[0][N] = 1;
    }
    if (K == 'H') {
      cards[1][N] = 1;
    }
    if (K == 'C') {
      cards[2][N] = 1;
    }
    if (K == 'D') {
      cards[3][N] = 1;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= 13; j++) {
      if (cards[i][j]) {
        continue;
      }
      if (i == 0) {
        K = 'S';
      }
      if (i == 1) {
        K = 'H';
      }
      if (i == 2) {
        K = 'C';
      }
      if (i == 3) {
        K = 'D';
      }
      cout << K << " " << j << endl;
    }
  }
  return 0;
}
