N,s = int(input()),input(); *v, = map(int,input().split()) for i in v: print(s[i-1],end='')