#include <iostream>
#include <string>
using namespace std;

int main() {
string suit;
int count = 0;
int num;
cin >> num;
string deck[52] = {};

for (int i = 0 ; i < 4; i++) {
for (int j = 1; j < 14; j++) {
string z = to_string(j);
if (i == 0 ) {
suit = "H";
} else if (i == 1) {
suit = "S";
} else if (i == 2) {
suit = "D";
} else {
suit = "C";
}deck[count] = suit + z;
count++;}
}
string p;
for (int i = 0; i < num; i++) {
int found = 1;
cin.getLine(line, p);
for (int j = 0; j < 52; j++) {
if (deck[j] == p) {
found = 0;
}
} if (found == 1) {
cout << p << " ";
}} cout << endl;
}


