#include <stdio.h>

int main(int argc, char** argv)
{
	int i, j, in_num, total, ar[4][13];
	char kind;

	memset(ar, '0', sizeof(ar));
	scanf("%d", &total);

	for (i = 0; i < total; i++) {
		scanf("%s %d", &kind, &in_num);

		if (kind == 'S') {
			ar[0][in_num-1] = 1;
		}
		else if (kind == 'H') {
			ar[1][in_num-1] = 1;
		}
		else if (kind == 'C') {
			ar[2][in_num-1] = 1;
		}
		else if (kind == 'D') {
			ar[3][in_num-1] = 1;
		}
	}

	for (i = 0; i < 4; i++) {
		for (j = 0; j < 13; j++) {
			if (ar[i][j] == 0) {
				char k = 0;
				switch (i) {
				case 0:
					k = 'S';
					break;
				case 1:
					k = 'H';
					break;
				case 2:
					k = 'C';
					break;
				case 3:
					k = 'D';
					break;
				}
				printf("%c %d\n", k, j+1);
			}
		}
	}
	return 0;
}