class Binary_Indexed_Tree: def __init__(self, n) -> None: self._n = n self.data = [0] * (n+1) self.depth = n.bit_length() def add(self, p, x) -> None: """任意の要素ai←ai+xを行う O(logn)""" assert 0 <= p < self._n p += 1 while p <= self._n: self.data[p-1] += x p += p & (-p) def sum(self, l, r) -> int: """区間[l,r)で計算""" assert 0 <= l <= r <= self._n return self._sum(r) - self._sum(l) def _sum(self, d) -> int: sm = 0 while d > 0: sm += self.data[d-1] d -= d & (-d) return sm N, Q = map(int, input().split()) A = list(map(int, input().split())) q = [list(map(str, input().split())) for _ in range(Q)] load = Binary_Indexed_Tree(N+5) B = [0]*N for s,x,y in q[::-1]: x = int(x) y = int(y) if s=='A': num = load._sum(x) B[x-1] += y*num else: load.add(x-1,1) load.add(y,-1) for i in range(N): num = load._sum(i+1) B[i] += A[i]*num print(*B)