#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int S[14], H[14], C[14], D[14];
  int num;
  char suit;
  for (int i = 0; i < n; i++) {
    cin >> suit >> num;
    if (suit == 'S')
      S[num] = num;
    else if (suit == 'H')
      H[num] = num;
    else if (suit == 'C')
      C[num] = num;
    else
      D[num] = num;
  }
  for (int i = 1; i < 14; i++)
    if (S[i] != i) cout << "S " << i << endl;
  for (int i = 1; i < 14; i++)
    if (H[i] != i) cout << "H " << i << endl;
  for (int i = 1; i < 14; i++)
    if (C[i] != i) cout << "C " << i << endl;
  for (int i = 1; i < 14; i++)
    if (D[i] != i) cout << "D " << i << endl;
  cout << "\n";
}
