#[macro_export] macro_rules! setup { { mut $input:ident: SplitWhitespace $(,)? } => { use std::io::Read; let mut buf = String::new(); std::io::stdin().read_to_string(&mut buf).unwrap(); let mut $input = buf.split_whitespace(); }; } #[macro_export] macro_rules! parse_next { ($str_iter:expr) => { $str_iter.next().unwrap().parse().unwrap() }; } use std::collections::HashMap; fn main() { setup! { mut input: SplitWhitespace }; let n: usize = parse_next!(input); let a: Vec = (0..n).map(|_| parse_next!(input)).collect(); let b: Vec = (0..(n - 1)).map(|_| parse_next!(input)).collect(); let mut colours = HashMap::new(); [ ("Red", 0), ("Orange", 1), ("Yellow", 2), ("Green", 3), ("Cyan", 4), ("Blue", 5), ("Violet", 6), ] .iter() .for_each(|(s, idx)| { colours.insert(String::from(*s), *idx as usize); }); let mut count_a = vec![0; 7]; for i in 0..n { count_a[*colours.get(&a[i]).unwrap()] += 1; } let mut count_b = vec![0; 7]; for i in 0..(n - 1) { count_b[*colours.get(&b[i]).unwrap()] += 1; } for j in 0..7 { if count_a[j] != count_b[j] { let colour = colours .iter() .filter(|(_, idx)| **idx == j) .map(|(s, _)| s) .nth(0) .unwrap(); println!("{}", colour); } } }