#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  int a[4][13];
  for (int i = 0; i < n; i++) {
    char mark;
    int num;
    std::cin >> mark >> num;
    int Mark;
    if (mark == 'S')
      Mark = 0;
    else if (mark == 'H')
      Mark = 1;
    else if (mark == 'C')
      Mark = 2;
    else if (mark == 'D')
      Mark = 3;
    a[Mark][num - 1] = 1;
  }
  std::cout << std::endl;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (a[i][j] != 1) {
        char Mark;
        if (i == 0)
          Mark = 'S';
        else if (i == 1)
          Mark = 'H';
        else if (i == 2)
          Mark = 'C';
        else if (i == 3)
          Mark = 'D';
        std::cout << Mark << " " << j + 1;
      }
    }
  }
}
