fn main() { let a = read::().chars().collect::>(); let s = read::(); for ch in s.chars() { if let Some(x) = ch.to_digit(10) { print!("{}", a[x as usize]); } else { print!("{}", ch); } } println!(""); } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() }