#include <stdio.h>
#define MAX_PIC 4
#define MAX_RANK 13

int main(void){
	int i, j, card_num, card[MAX_PIC][MAX_RANK], card_answer[MAX_PIC][MAX_RANK];
	char picture;
	int picture_num, rank;
	
	scanf("%d", &card_num);
	
	// ?????????????????????
	for(i = 0; i < MAX_PIC; i++){
		for(j = 0; j < MAX_RANK; j++){
			card[i][j] = 0;
		}
	}
	
	
	for(i = 0; i < card_num, i++){
		scanf("%c %d", &picture, &rank);
		switch(picture){
		case 'S': picture_num = 0; break;
		case 'H': picture_num = 1; break;
		case 'C': picture_num = 2; break;
		case 'D': picture_num = 3; break;
		}
		card[picture_num][rank] = 1;
	}
	
	
	for(i = 0; i < MAX_PIC; i++){
		for(j = 0; j < MAX_RANK; j++){
			if(card[i][j] == 0){
				switch(i){
				case 0: picture = 'S'; break;
				case 1: picture = 'H'; break;
				case 2: picture = 'C'; break;
				case 3: picture = 'D'; break;
				}
				printf("%c %d\n", picture, rank);
			}
		}
	}
	
	return 0;
}