N, Q = map(int,input().split()) a = list(map(int,input().split())) s = input() t = list(map(int,input().split())) assert 1 <= N <= 100000 assert 0 <= Q <= 100000 assert len(a) == N assert len(s) == N assert len(t) == Q for i in range(N): assert 0 <= a[i] <= 1000000000 assert s[i] == '0' or s[i] == '1' for i in range(Q): assert 0 <= t[i] <= 1000000000