#include <bits/stdc++.h>
using namespace std;
int main(void) {
  bool cards[4][13], n, rank;
  char stamp;
  do {
    cin >> n;
  } while (n < 0 || n > 52);
  int i = 0;
  while (1) {
    cin >> stamp >> rank;
    switch (stamp) {
      case 'S':
        cards[0][rank - 1] = true;
        break;
      case 'H':
        cards[1][rank - 1] = true;
        break;
      case 'C':
        cards[2][rank - 1] = true;
        break;
      case 'D':
        cards[3][rank - 1] = true;
        break;
      default:
        break;
    }
    if (i++ == 52) break;
  }
  for (int i = 0; i < rank; i++) {
    for (int j = 0; j < 4; j++) {
      if (cards[j][i] == true) {
        switch (j) {
          case 0:
            printf("S ");
            break;
          case 1:
            printf("H ");
            break;
          case 2:
            printf("C ");
            break;
          case 3:
            printf("D ");
            break;
          default:
            break;
        }
        printf("%d\n", i);
      }
    }
  }
  return 0;
}
