#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[n][2];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> a[i][j];
    }
  }
  int q[4][13];
  for (int i = 0; i < n; i++) {
    if (a[i][0] == 'S') {
      int t = a[i][1];
      q[0][t - 1] = 12;
    } else if (a[i][0] == 'H') {
      int t = a[i][1];
      q[1][t - 1] = 12;
    } else if (a[i][0] == 'C') {
      int t = a[i][1];
      q[2][t - 1] = 12;
    } else {
      int t = a[i][1];
      q[3][t - 1] = 12;
    }
  }
  for (int j = 0; j < 13; j++) {
    if (q[0][j] != 12)
      cout << "S"
           << " " << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (q[1][j] != 12)
      cout << "H"
           << " " << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (q[2][j] != 12)
      cout << "C"
           << " " << j + 1 << endl;
  }
  for (int j = 0; j < 13; j++) {
    if (q[3][j] != 12)
      cout << "D"
           << " " << j + 1 << endl;
  }
  return 0;
  return 0;
}
