N, Q = map(int, input().split()) A = list(map(int, input().split())) S = input() lis = [[0]*31 for _ in range(2)] q = 1 for p in range(31): score = 0 r = q for i in range(N): u = A[i]&(1<