use std::collections::HashMap; fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim().chars().collect::>(); let mut wordmap = HashMap::new(); for (i, &c) in s.iter().enumerate() { wordmap.entry(c).or_insert(vec![]).push(i); } for (&c, v) in wordmap.iter() { if v.len() == 1 { println!("{} {}", v[0]+1, c); } } }