
import java.util.Scanner;

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

		// S = 0, H = 1, C = 2, D = 3 ??§?????????
		// ?????????????????????????????????????????????*13 + ??????????????°???-1

		int n = 0;
		boolean number[] = new boolean[52]; // ????????????????????????????????±??????
		int mark = 0;
		int cardNum = 0;

		// n??????????????????????????????????????¨????????????
		Scanner stdIn = new Scanner(System.in);
		n = stdIn.nextInt();

		boolean a = false;
		for (int i = 0; i < n; i++) {

			// ????????????????????\?????????
			String moji = stdIn.next();

			if (moji.equals("S")) {
				mark = 0;
			}
			else if (moji.equals("H")) {
				mark = 1;
			}
			else if (moji.equals("C")) {
				mark = 2;
			}
			else if (moji.equals("D")) {
				mark = 3;
			}

			cardNum = stdIn.nextInt();
			number[mark * 13 + cardNum - 1] = true;
		}

		for (int i = 0; i < number.length; i++) {
			String mark1 = "";	//?????????
			if (number[i] == false) {
				mark = i / 13;

				if (mark == 0) {
					mark1 = "S";
				}
				else if (mark == 1) {
					mark1 = "H";
				}
				else if (mark == 2) {
					mark1 = "C";
				}
				else if (mark == 3) {
					mark1 = "D";
				}

				cardNum = i % 13 + 1;
				System.out.println(mark1 + " " + cardNum);
			}
		}
		stdIn.close();
		if (a) {
			return;
		}

	}

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