#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  char c;
  cin >> n;
  int trump[4][13];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 14; j++) {
      trump[i][j] = 1;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      cin >> c;
      cin >> k;
      if (c == 'S')
        trump[0][j] = k;
      else if (c == 'H')
        trump[1][j] = k;
      else if (c == 'C')
        trump[2][j] = k;
      else if (c == 'D')
        trump[3][j] = k;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 13; j++) {
      if (trump[i][j] == 0) {
        if (i == 0)
          cout << 'S';
        else if (i == 1)
          cout << 'H';
        else if (i == 2)
          cout << 'C';
        else if (i == 3)
          cout << 'D';
        cout << " ";
        cout << j + 1 << endl;
      }
    }
  }
}
