N=int(input()) S=input() P=list(map(int,input().split())) ans="" for p in P: p-=1 ans+=S[p] print(ans)