n,k,t = map(int,input().split()) a = list(input().split()) b = list(map(int,input().split())) t %= 2*k; vi = []; x = []; ans = [0]*n for i,v in enumerate(b): vi.append((v,i)) if a[i]=="A": if 0<=t