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