#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int spade[13] = {};
  int heart[13] = {};
  int club[13] = {};
  int diamond[13] = {};
  char suit;
  int temp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> suit;
    switch (suit) {
      case 'S':
        cin >> temp;
        spade[temp - 1] = 1;
        break;
      case 'H':
        cin >> temp;
        heart[temp - 1] = 1;
        break;
      case 'C':
        cin >> temp;
        club[temp - 1] = 1;
        break;
      case 'D':
        cin >> temp;
        diamond[temp - 1] = 1;
        break;
    }
  }
  for (int j = 0; j < 13; j++) {
    if (spade[j] != 1) {
      printf("\nS %d", j + 1);
    }
  }
  for (int j = 0; j < 13; j++) {
    if (heart[j] != 1) {
      printf("\nH %d", j + 1);
    }
  }
  for (int j = 0; j < 13; j++) {
    if (club[j] != 1) {
      printf("\nC %d", j + 1);
    }
  }
  for (int j = 0; j < 13; j++) {
    if (diamond[j] != 1) {
      printf("\nD %d", j + 1);
    }
  }
  return 0;
}
