use proconio::{fastout, input, marker::Bytes}; #[fastout] fn main() { input! { n: usize, s: Bytes, p: [u8; n], } println!("{}", output(solve(s, p))); } fn solve(s: Vec, p: Vec) -> Vec { p.into_iter().map(|p| s[(p - 1) as usize]).collect() } fn output(ans: Vec) -> String { String::from_utf8(ans).unwrap() }