import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		if (n <= 52) {
			List<String> list = new ArrayList<String>(n);
			for (int i = 0; i <= n; i++) {
				String str = scan.nextLine();
				list.add(str);
			}
			List<Integer> S = new ArrayList<>();
			List<Integer> H = new ArrayList<>();
			List<Integer> C = new ArrayList<>();
			List<Integer> D = new ArrayList<>();
			List<Integer> parent = Arrays.asList(new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
			List<Integer> s = new ArrayList<>(parent);
			List<Integer> h = new ArrayList<>(parent);
			List<Integer> c = new ArrayList<>(parent);
			List<Integer> d = new ArrayList<>(parent);
			for (int i = 0; i < list.size(); i++) {
				if (list.get(i).startsWith("S")) {
					S.add(Integer.parseInt(list.get(i).replaceAll("[^0-9] ", "")));
				} else if (list.get(i).startsWith("H")) {
					H.add(Integer.parseInt(list.get(i).replaceAll("[^0-9] ", "")));
				} else if (list.get(i).startsWith("C")) {
					C.add(Integer.parseInt(list.get(i).replaceAll("[^0-9] ", "")));
				} else if (list.get(i).startsWith("D")) {
					D.add(Integer.parseInt(list.get(i).replaceAll("[^0-9] ", "")));
				}
			}
			s.removeAll(S);
			h.removeAll(H);
			c.removeAll(C);
			d.removeAll(D);
			S.clear();
			H.clear();
			C.clear();
			D.clear();
			list.clear();
			if (s.size() != 0) {
				for (int diff : s) {
					list.add("S " + String.valueOf(diff));
				}
			}
			if (h.size() != 0) {
				for (int diff : h) {
					list.add("H " + String.valueOf(diff));
				}
			}
			if (c.size() != 0) {
				for (int diff : c) {
					list.add("C " + String.valueOf(diff));
				}
			}
			if (d.size() != 0) {
				for (int diff : d) {
					list.add("D " + String.valueOf(diff));
				}
			}
			s.clear();
			h.clear();
			c.clear();
			d.clear();
			for (String str : list) {
				System.out.println(str);
			}
		}
	}
}