#include <bits/stdc++.h>
using namespace std;
void print_lack_card(int ptn, int num) {
  switch (ptn) {
    case 0:
      cout << "S";
      break;
    case 1:
      cout << "H";
      break;
    case 2:
      cout << "C";
      break;
    case 3:
      cout << "D";
      break;
  }
  cout << " " << num + 1 << "\n";
}
int main() {
  int cards[4][13];
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      cards[i][j] = 0;
    }
  }
  int n;
  cin >> n;
  char ptn;
  int num;
  for (i = 0; i < n; i++) {
    cin >> ptn >> num;
    if (ptn == 'S') {
      cards[0][num] = 1;
    } else if (ptn == 'H') {
      cards[1][num] = 1;
    } else if (ptn == 'C') {
      cards[2][num] = 1;
    } else if (ptn == 'D') {
      cards[3][num] = 1;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++) {
      if (cards[i][j] == 0) print_lack_card(i, j);
    }
  }
  return 0;
}
