N,M=map(int, input().split()) *A,=map(int, input().split()) S=input() l=r=0 i=imin=imax=0 for s in S: if s=='L': l+=1 i-=1 else: r+=1 i+=1 imin = min(imin, i) imax = max(imax, i) ans=[0]*N for i in range(N): j=i j+=max(0, -imin-j) j-=max(0, imax-(N-j-1)) j=j+r-l j=max(0,min(N-1,j)) ans[j]+=A[i] print(*ans)