use std::io; use std::collections::HashMap; fn process(input: &str) -> Option { let char_map = input.chars().fold(HashMap::new(), |mut acc, c| { *acc.entry(c).or_insert(0) += 1; acc }); if char_map.len() != 7 { return None; } if let Some(x) = char_map.iter().find(|entry| *entry.1 == 1) { Some(*x.0) } else { None } } fn main() { let mut input = String::new(); io::stdin().read_line(&mut input).ok(); if let Some(x) = process(&input.trim()) { println!("{}", x); } else { println!("Impossible"); } }