import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????°????????????
		int cards[][] = new int[4][13];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//cards???????????????????????????
			for(int cnt2 = 0; cnt2 < 13; cnt2++){
				cards[cnt1][cnt2] = 0;
			}
		}
		for(int cnt_card = 0; cnt_card < n; cnt_card++){//??°????????\?????????
			String mark = scan.next();
			int val = scan.nextInt();
			switch(mark){//cards?????????????????£??????????????????????????§????????????
				case "S":
					cards[0][val - 1] = 1;
					break;
				case "H":
					cards[1][val - 1] = 1;
					break;
				case "C":
					cards[2][val - 1] = 1;
					break;
				case "D":
					cards[3][val - 1] = 1;
			}
		}
		for(int cnt1 = 0; cnt1 < 4; cnt1++){
			for(int cnt2 = 0; cnt2 < 13; cnt2++){
				if(cards[cnt1][cnt2] == 0){//cards??????????????????????????????
					switch(cnt1){//cnt1???????????????????¢??????????????????????
					case 0:
						System.out.println("S " + (cnt2 + 1));
						break;
					case 1:
						System.out.println("H " + (cnt2 + 1));
						break;
					case 2:
						System.out.println("C " + (cnt2 + 1));
						break;
					case 3:
						System.out.println("D " + (cnt2 + 1));
					}
				}
			}
					
		}
    scan.close();
	}
}
/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