N = int(input()) S = input() for i in range(0, N): P = int(input()) print(S[P - 1], end=None) print()