N, K, T = map(int, input().split()) A = list(input().split()) B = list(map(int, input().split())) nB = [] for i in range(N): if A[i] == "A": if B[i] > T: nB.append(B[i]-T) else: if (T-B[i])%(K*2) < K: nB.append((T-B[i])%(K*2)) else: nB.append(K-(T-B[i])%(K*2)+K) else: if K-B[i] > T: nB.append(K-((K-B[i])-T)) else: if (T-(K-B[i]))%(K*2) < K: nB.append(K-(T-(K-B[i]))%(K*2)) else: nB.append((T-(K-B[i]))%(K*2)-K) S = sorted([(i, b) for i, b in enumerate(B)], key=lambda x:x[1]) nB.sort() ans = [-1]*N for i in range(N): ans[S[i][0]] = nB[i] print(*ans)