#include <stdio.h>

#define RANK 13
#define SUIT 4

int enc(char);
char dec(int);

int main(void)
{
	int card[SUIT][RANK];
	int n, i, j, num;
	char suit_c;

	for(i = 0;i < SUIT;i++)
		for(j = 0;j < RANK;j++)
			card[i][j] = 0;
	scanf("%d", &n);
	for(i = 0;i < n;i++)
	{
		scanf("%c %d", &suit_c, &num);
		card[enc(suit_c)][num - 1] = 1;
	}
	for(i = 0;i < SUIT;i++)
		for(j = 0;j < RANK;j++)
			if(card[i][j] == 0)
				printf("%c %d\n", dec(i), j + 1);

	return 0;
}

int enc(char suit_char)
{
	switch(suit_char)
	{
		case 'S':
			return 0;
			break;
		case 'H':
			return 1;
			break;
		case 'C':
			return 2;
			break;
		case 'D':
			return 3;
			break;
		default:
			break;
	}
}