use std::collections::HashMap; fn main() { let mut xx = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok(); let xx: Vec> = xx.split_whitespace().map(|s| s.chars().collect()).collect(); let map: HashMap = ('0'..='9') .enumerate() .map(|(i, c)| (c, xx[0][i])) .collect(); let answer: String = xx[1] .iter() .map(|&c| if ('0'..='9').contains(&c) { map[&c] } else { c }) .collect(); println!("{answer}"); }