#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, timer, r, p;
  int ddd[4][13];
  char n;
  p = 0;
  while (1) {
    p++;
    while (1) {
      r++;
      ddd[p][r] = 0;
      if (r == 13) {
        break;
      }
    }
    r = 0;
    if (p == 0) {
      break;
    }
  }
  cin >> timer;
  while (1) {
    cin >> n >> t;
    if (n == 'S') {
      ddd[1][t] = 1;
    }
    if (n == 'H') {
      ddd[2][t] = 1;
    }
    if (n == 'C') {
      ddd[3][t] = 1;
    }
    if (n == 'D') {
      ddd[4][t] = 1;
    }
    timer--;
    if (timer == 0) {
      break;
    }
  }
  r = 0;
  while (1) {
    r++;
    if (ddd[1][r] == 0) {
      cout << "S " << r << endl;
    }
    if (r == 13) {
      break;
    }
  }
  r = 0;
  while (1) {
    r++;
    if (ddd[2][r] == 0) {
      cout << "H " << r << endl;
    }
    if (r == 13) {
      break;
    }
  }
  r = 0;
  while (1) {
    r++;
    if (ddd[3][r] == 0) {
      cout << "C " << r << endl;
    }
    if (r == 13) {
      break;
    }
  }
  r = 0;
  while (1) {
    r++;
    if (ddd[4][r] == 0) {
      cout << "D " << r << endl;
    }
    if (r == 13) {
      return 0;
    }
  }
  return 0;
}
