#include <stdio.h>

int main(void)
{
	int i, n, id, rank;
	short card[4][14];
	char buf[100], *p;
	char ids[4] = { 'S', 'H', 'C', 'D' };

	for (id = 0; id < 4; id++) {
		for (rank = 1; rank <= 13; rank++) card[id][rank] = 1;
	}
	gets(buf);
	n = atoi(buf);
	for (i = 0; i < n; i++) {
		gets(buf);
		p = buf;
		while (isspace(*p)) p++;
		switch (*p) {
		case 'S': id = 0; break;
		case 'H': id = 1; break;
		case 'C': id = 2; break;
		case 'D': id = 3; break;
		}
		rank = atoi(++p);
//		printf("id=%d, rank=%d\n", id, rank);
		card[id][rank] = 0;
	}
	for (id = 0; id < 4; id++) {
		for (rank = 1; rank <= 13; rank++) {
			if (card[id][rank]) printf("%c %d\n", ids[id], rank);
		}
	}
	return 0;
}

