fn main() {
	let mut s = [false; 13];
	let mut h = [false; 13];
	let mut c = [false; 13];
	let mut d = [false; 13];
	
	let n = readLine::<usize>();
	for _ in 0..n {
	    let mut line = String::new();
	    std::io::stdin().read_line(&mut line).ok();
		let v : Vec<&str> = line.trim().split_whitespace().collect();
		let (suit, i) = (v[0], v[1].parse::<usize>().ok().unwrap() - 1);
		
		match suit {
			"S" => s[i] = true,
			"H" => h[i] = true,
			"C" => c[i] = true,
			"D" => d[i] = true,
			_   => panic!(),
		}
	}
	print_card("S", s);
	print_card("H", h);
	print_card("C", c);
	print_card("D", d);
}

fn print_card(suit: &str, xs: [bool; 13]) {
	for i in 0..13 {
		if !xs[i] {
			println!("{} {}", suit, i + 1);
		}
	}
}
