#include <bits/stdc++.h>
using namespace std;
bool S[13], H[13], C[13], D[13];
int main() {
  int n, number;
  char symbol;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> symbol;
    if (symbol == 'S') {
      cin >> number;
      S[number - 1] = 0;
    } else if (symbol == 'H') {
      cin >> number;
      H[number - 1] = 0;
    } else if (symbol == 'C') {
      cin >> number;
      C[number - 1] = 0;
    } else {
      cin >> number;
      D[number - 1] = 0;
    }
  }
  for (int j = 0; j < 13; j++) {
    if (S[j] == 1) cout << 'S' << ' ' << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (H[j] == 1) cout << 'H' << ' ' << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (C[j] == 1) cout << 'C' << ' ' << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (D[j] == 1) cout << 'D' << ' ' << j + 1 << endl;
  }
}
