n = int(input()) s = input() t = ''.join(s[i - 1] for i in map(int, input().split())) print(t)