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