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