import sys input = sys.stdin.readline class BIT: def __init__(self, n): self.n = n self.bit = [0]*(n+1) def add(self, i, x): i += 1 while i<=self.n: self.bit[i] += x i += i&(-i) def acc(self, i): s = 0 while i>0: s += self.bit[i] i -= i&(-i) return s N, Q = map(int, input().split()) A = list(map(int, input().split())) cxy = [tuple(input().split()) for _ in range(Q)] ans = [0]*N bit = BIT(N) for c, x, y in cxy[::-1]: x, y = int(x), int(y) if c=='A': ans[x-1] += y*bit.acc(x) else: bit.add(x-1, 1) bit.add(y, -1) for i in range(N): ans[i] += A[i]*bit.acc(i+1) print(*ans)