#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int cards[4][13];
  string picture;
  int num;
  scanf("%d", &n);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cards[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> picture >> num;
    if (picture == "S") {
      cards[0][num - 1] = 1;
    } else if (picture == "H") {
      cards[1][num - 1] = 1;
    } else if (picture == "C") {
      cards[2][num - 1] = 1;
    } else if (picture == "D") {
      cards[3][num - 1] = 1;
    } else {
      printf("Invalid character\n");
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (cards[i][j] == 1) {
        if (i == 0) {
          printf("S %d\n", j + 1);
        } else if (i == 1) {
          printf("H %d\n", j + 1);
        } else if (i == 2) {
          printf("C %d\n", j + 1);
        } else if (i == 3) {
          printf("D %d\n", j + 1);
        }
      }
    }
  }
  return 0;
}
