import sys n = int(input().split()[0]) a = list(map(int, input().split())) q = [s.split() for s in sys.stdin] b = [0]*n t = [0]*(1+n) l = [0]*(n+1) for c, x, y in reversed(q): x, y = int(x), int(y) if c>'A': for i, d in [(x, 1), (y+1, -1)]: l[i-1] += d while i<=n: t[i] += d i += i&-i else: s, i = 0, x while i: s += t[i] i -= i&-i b[x-1] += s * y s = 0 for i in range(n): s += l[i] b[i] += s * a[i] print(*b)