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