#include <stdio.h>

int main(void)
{
	int is_find[255][13] = {};
	int n;
	int i, j;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		char str[16];
		char mark;
		int id;

		scanf("%s", str);
		mark = *str;
		id = atoi(str + 2) - 1;

		is_find[mark][id] = 1;
	}
	for (i = 0; i < 4; i++){
		char mark = "SHCD"[i];
		for (j = 0; j < 13; j++){
			if (!is_find[mark][j]) printf("%c %d\n", mark, j + 1);
		}
	}
	return (0);
}