use std::io::*; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let mut mn: Vec = itr.map(|e| e.to_string()).collect(); let mut t = Vec::::new(); for a in ['D', 'C', 'H', 'S'].to_vec() { for b in [ 'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', ].to_vec() { t.push(format!("{}{}", a, b)); } } let mut ans = Vec::::new(); for s in t { if mn.contains(&s) { ans.push(s); } } println!("{}", ans.join(" ")); }