use std::collections::HashMap; fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s: &str = s.trim(); let mut c2c: HashMap = HashMap::new(); s.chars().for_each(|c| { if let Some(x) = c2c.get_mut(&c) { *x += 1; } else { c2c.insert(c, 1); } }); if c2c.len() != 7 || c2c.iter().filter(|pair| *pair.1 != 2).count() != 1 { println!("Impossible"); } else { println!("{}", c2c.iter().find(|pair| *pair.1 == 1).map(|pair| pair.0).unwrap()); } }