import java.util.Scanner;

/**
 * ??¢?´¢?????????
 *
 * @author B7078
 *
 */
class Trump {
	public void trump(int count) {
		String str;
		int ret;
		String g[] = new String[2];
		boolean trump[][] = new boolean[4][13];
		/**
		 * ??\????????????true or false??????????????¨?????¶????¨???¶
		 */
		for (int i = 0; i < count; ++i) { // ?????????????????°(count)????????°?????????
			Scanner scan = new Scanner(System.in); // ??????????????\???
			str = scan.next();
			g[0] = str;
			str = scan.next();
			g[1] = str;

			ret = Integer.parseInt(g[1])-1;

			if(g[0].equals("S")){
				trump[0][ret] = true;
			}
			else if(g[0].equals("H")){
				trump[1][ret] = true;
			}
			else if(g[0].equals("C")){
				trump[2][ret] = true;
			}
			else if(g[0].equals("D")){
				trump[3][ret] = true;
			}

			/*if (str.matches(".*S*.")) { // ??????????????????????????\
				trump[0][ret] = true;
			} else if (str.matches(".*H*.")) { // ???????????????????????\
				trump[1][ret] = true;
			} else if (str.matches(".*C*.")) { // ???????????????????????\
				trump[2][ret] = true;
			} else if (str.matches(".*D*.")) { // ???????????????????????\
				trump[3][ret] = true;
			}*/
		}
		/**
		 * ???????????¶?????????false(?¬??????????????????????)???????????????
		 */
		for (int p = 0; p < 4; ++p) {
			for (int k = 0; k < 13; ++k) {
				if (trump[p][k] == false) {
					if (p == 0) { //S??????
						System.out.println("S" + " " + (k+1));
					} else if (p == 1) { //H??????
						System.out.println("H" + " " + (k+1));
					} else if (p == 2) { //C??????
						System.out.println("C" + " " + (k+1));
					} else if (p == 3) { //D??????
						System.out.println("D" + " " + (k+1));
					}
				}
			}
		}
	}

}

public class Main {

	public static void main(String[] args) {
		/**
		 *
		 */
		Trump trump1 = new Trump();
		/**
		 * ?????°?????£?¨?
		 */
		int n = 0;
		int count = 0;
		/**
		 * n(??????????????°)?????\???
		 */
		Scanner scan = new Scanner(System.in);
		count = scan.nextInt(); // n<=52 (0:S 1:H 2:C 3:D)
		/**
		 * ??????????????????????????¨??????
		 */
		if(count<=52){
		trump1.trump(count);
		}
	}

}