use std::{ cell::RefCell, fmt::Debug, io::{BufWriter, StdinLock, StdoutLock, stdin, stdout}, str::FromStr, }; fn main() { let s = read_line(); let mut v = s.chars().collect::>(); v.dedup(); for c in v { if s.chars().filter(|x| *x == c).count() == 1 { println!("{} {}", 1 + s.chars().position(|x| x == c).unwrap(), c); return; } } } thread_local! { static STDIN: RefCell> = RefCell::new(stdin().lock()); static STDOUT: RefCell>> = RefCell::new(BufWriter::new(stdout().lock())); } #[allow(dead_code)] fn read() -> T where ::Err: Debug, { read_line().parse().unwrap() } #[allow(dead_code)] fn read_vec() -> Vec where ::Err: Debug, { read_line() .split_whitespace() .map(|x| x.parse().unwrap()) .collect() } #[allow(dead_code)] fn read_tuple() -> [T; N] where T: Debug, ::Err: Debug, { read_vec::().try_into().unwrap() } fn read_line() -> String { use std::io::BufRead; let mut s = String::new(); STDIN.with(|cell| { cell.borrow_mut().read_line(&mut s).unwrap(); }); String::from_str(s.trim_end()).unwrap() } #[macro_export] macro_rules! print { ($($t:tt)*) => { use std::io::Write; STDOUT.with(|cell| write!(cell.borrow_mut(), $($t)*).unwrap()) }; } #[macro_export] macro_rules! println { ($($t:tt)*) => { use std::io::Write; STDOUT.with(|cell| writeln!(cell.borrow_mut(), $($t)*).unwrap()) }; }