use std::io::*; use std::str::FromStr; #[allow(dead_code)] fn get_line() -> String { let stdin = stdin(); let mut line = String::new(); stdin.lock().read_line(&mut line).expect("io error."); line.trim().to_string() } #[allow(dead_code)] fn get_word() -> T { (&get_line()).parse().ok().expect("parse error.") } #[allow(dead_code)] fn get_vec() -> Vec { (&get_line()).split(' ').map(|x| x.parse().ok().expect("parse error.")).collect() } fn main() { let s = get_line(); let mut ans = String::new(); for (i, c) in s.chars().enumerate() { ans.push(cycle(i, c)); } println!("{}", ans); } fn cycle(i: usize, c: char) -> char { let uc = c as u32; let ua = 'A' as u32; let to = ((uc - ua + 26 * 100 - (i as u32 + 1)) % 26 + ua) as u8; to as char }