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