# include<iostream>
# include<stdio.h>

using namespace std;
int main(void){
	int i,j,n,no;
	int card[4][14];
		scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%c,%d", &mark, &no);
		switch (mark){
		case'S':
				card[0][no] = 99;
				break;
		case'H':
				card[0][no] = 99;
				break;
		case'C':
				card[0][no] = 99;
				break;
		case'D':
				card[0][no] = 99;
				break;

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