import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		//???????????£?¨??????????
		int Card [][];
		Card = new int[4][13];

		//????????°????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();


		//N?????°?????????
		for(int i = 0; i < N ; i++){

			//????????¨??°???????????£?????????
			String Mark = sc.next();
			int Suji = sc.nextInt();

			//?????????S?????£??????1
			if(Mark.equals ("S")){
				//??£??\??????
				Card[0][Suji-1] = 1;
			}
			//?????????H?????£??????1
			if(Mark.equals ("H")){
				//??£??\??????
				Card[1][Suji-1] = 1;
			}
			//?????????C?????£??????1
			if(Mark.equals ("C")){
				//??£??\??????
				Card[2][Suji-1] = 1;
			}
			//?????????D?????£??????1
			if(Mark.equals ("D")){
				//??£??\??????
				Card[3][Suji-1] = 1;
			}
		}

		//?????£??????????????¨
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < 13; j++){
				//1??????????????£????????????
				if(Card[i][j] == 0){

					//0?????£??????S
					if(Card[i] == Card[0]){
						System.out.println("S " + (j + 1));
					//1?????£??????H
					}else if(Card[i] == Card[1]){
						System.out.println("H " + (j + 1));
					//2?????£??????C
					}else if(Card[i] == Card[2]){
						System.out.println("C " + (j + 1));
					//3?????£??????D
					}else if(Card[i] == Card[3]){
						System.out.println("D " + (j + 1));
					}
				}
			}
		}
		sc.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