import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String have = br.readLine();
		int[][] card = new int[4][13];
		int exc = 0 ;
		String[] mark = {"S","H","C","D"};
		for(int i= 0 ; i < Integer.parseInt(have) ; i++){
			String str = br.readLine();
			String[] strc = str.split(" ");
			if("S".equals(strc[0])){
				exc =  Integer.parseInt(strc[1]);	
				card[0][exc-1] = exc ;
			} else if("H".equals(strc[0])){
				exc =  Integer.parseInt(strc[1]);	
				card[1][exc-1] = exc ;
			} else if("C".equals(strc[0])){
				exc =  Integer.parseInt(strc[1]);	
				card[2][exc-1] = exc ;
			} else if("D".equals(strc[0])){
				exc =  Integer.parseInt(strc[1]);	
				card[3][exc-1] = exc ;
			}
		}
		for(int j = 0 ; j < card.length ; j++){
			for (int k = 0 ; k < card[j].length ; k++){
				if(card[j][k] == 0 ){
					card[j][k] = k+1;
					System.out.println(mark[j] + " " + card[j][k]);
				}
			}
		}
	}

}
/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