import java.util.Scanner;

class Main{
     public static void main(String[] args){
	//???????????\???
    	Scanner scan = new Scanner(System.in);
	//???????????´??°?????????????????£??\
    	int n = scan.nextInt();
	//boolean??????????´???°???[4][13]??¨??????
    	boolean[][] cards = new boolean[4][13];
    	String s = null;
    	int num;
    	
    	//n?????????????????????s?????????????????£???????????????????????????true?????£??\
    	for(int i = 0; i < n; i++){
    		s = scan.next();
    		num = scan.nextInt();
    		num--;
    		
    		
    		switch(s){
    			case "S":
    				cards[0][num] = true;
    				break;
    			case "H":
    				cards[1][num] = true;
    				break;
    			case "C":
    				cards[2][num] = true;
    				break;
    			case "D":
    				cards[3][num] = true;
    				break;
    		}
    	}
    	
	//????????????????????°??????????????????false????????????????????????
    	for(int j = 0; j < 4; j++){
    		for(int i = 1; i < 14; i++){
    			if(cards[j][i - 1] == true){   				
    			}else{
    				switch(j){
    				  case 0:
    					  s = "S";
    					  break;
    				  case 1:
    					  s = "H";
    					  break;
    				  case 2:
    					  s = "C";
    					  break;
    				  case 3:
    					  s = "D";
    					  break;
    				}   				
    				System.out.println(s + " " + i);
    			}
    			
    		}
    	}
     }
}
/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