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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// ????????????????????°????????????????????????
		int Mark = 4;
		int Num = 13;
		// ????????????????????°????????????????????????
		int cards_Array[][] = new int[Mark][Num];
		String cards = input.readLine();
		// ?????£??????????????????????????°?????????
		int num_of_T = Integer.parseInt(cards);
		int mark_num = 0;
		int card_num = 0;

		for (int i = 0; i < num_of_T; i++) {
			String input_b = input.readLine();
			String[] strAry = input_b.split(" ");
			// ??????????????????
			String T_Mark = strAry[0];
			// ?????????????????????????????\??????????????¨??????????????????
			if (T_Mark.equals("S")) {
				mark_num = 0;
			} else if (T_Mark.equals("H")) {
				mark_num = 1;
			} else if (T_Mark.equals("C")) {
				mark_num = 2;
			} else if (T_Mark.equals("D")) {
				mark_num = 3;
			}
			// ?????????????????°
			card_num = Integer.parseInt(strAry[1]);
			cards_Array[mark_num][card_num - 1] = 1;
		}
              //??????????????°
		for (int design_gr = 0; design_gr < Mark; design_gr++) {
			//??°???
			for (int number_gr = 0; number_gr < Num; number_gr++) {
				// ??????Array???????´??????????Array_input???????´?????????????
				if (cards_Array[design_gr][number_gr] != 1) {
					int cards_of_re = number_gr + 1;
					if (design_gr == 0) {
						System.out.println("S" + " " + cards_of_re);
					} else if (design_gr == 1) {
						System.out.println("H" + " " + cards_of_re);
					} else if (design_gr == 2) {
						System.out.println("C" + " " + cards_of_re);
					} else {
						System.out.println("D" + " " + cards_of_re);
					}

				}

			}

		}

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