n, m = map(int, input().split()) a = list(map(int, input().split())) s = input().strip() S_val = 0 L = -10**18 R = 10**18 for c in s: if c == 'L': S_val -= 1 L = max(1, L - 1) R = max(1, R - 1) else: S_val += 1 L = min(n, L + 1) R = min(n, R + 1) ans = [0] * n for i in range(n): current_i = i + 1 # classrooms are 1-based pos = current_i + S_val pos = max(L, min(R, pos)) ans[pos - 1] += a[i] print(' '.join(map(str, ans)))