n = int(input()) s = input() p = list(map(int, input().split())) out = "" for i in range(n): out = out+s[p[i]-1] print(out)