import java.util.Scanner;

public class Main {
public static void main(String [] args){
		
		Scanner scan = new Scanner(System.in);
		
		int cards[][];
		cards = new int[4][13];
		int i, j, num;
		
		for(i=0; i<4; i++){
			num = 1;
			for(j=0; j<13; j++){
				cards[i][j] = num;
				num++;
			}
		}
		
		int a = scan.nextInt();
		for(i=0; i<a; i++){
			char op = scan.next().charAt(0);
			int c = scan.nextInt();
			
			if(op == 'S'){
				cards[0][c-1] = 0; 
			}
			if(op == 'H'){
				cards[1][c-1] = 0; 
			}
			if(op == 'C'){
				cards[2][c-1] = 0; 
			}
			if(op == 'D'){
				cards[3][c-1] = 0; 
			}
		}
		
		for(i=0; i<4; i++){
			for(j=0; j<13; j++){
				if(cards[i][j] != 0){
					if(i==0){
						System.out.println("S "+cards[i][j]);
					}
					if(i==1){
						System.out.println("H "+cards[i][j]);
					}
					if(i==2){
						System.out.println("C "+cards[i][j]);
					}
					if(i==3){
						System.out.println("D "+cards[i][j]);
					}
					
				}
			}
		}
		
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz