N,K,T=map(int,input().split())
a=list(map(str,input().split()))
b=list(map(int,input().split()))
c=[-1 for _ in range(N)]
d=[]
for i in range(N):
    d.append([b[i],i])
d.sort()
T%=(2*K)
for i in range(N):
    if a[i]=='A':
        c[i]=2*K-b[i]
    else:
        c[i]=b[i]
    c[i]+=T
    c[i]%=2*K
    if c[i]>K:
        c[i]=2*K-c[i]
c.sort()
ans=[-1 for _ in range(N)]
for i in range(N):
    ans[d[i][1]]=c[i]
print(*ans)