n = read_line.to_i s = read_line.chars p = read_line.split.map { |v| v.to_i - 1 } puts n.times.map { |i| s[p[i]] }.join