#include <stdio.h>
#include <iostream>
using namespace std;

int main(void)
{		
	int n;
	int trump[4][13] = {0};
	cin >> n;
	for (int i = 0; i < n; i++) {
		char mark;
		int mark_n;
		cin >> mark;
		if (mark == 'S') mark_n = 0;
		else if (mark == 'H') mark_n = 1;
		else if (mark == 'C') mark_n = 2;
		else if (mark == 'D') mark_n = 3;
		
		int rank;
		cin >> rank;
		trump[mark_n][rank - 1] = 1;
	}
	
	char marks[4] = {'S', 'H', 'C', 'D'};
	for (int j = 0; j < 4; j++) {
		for (int k = 0; k < 13; k++) {
			if (trump[j][k] == 0) {
				cout << marks[j] << " " << k + 1 << endl;
			}
	return 0;
}