class Bit: def __init__(self, n): self.size = n self.tree = [0] * (n + 1) def sum(self, i): s = 0 while i > 0: s += self.tree[i] i -= i & -i return s def add(self, i, x): while i <= self.size: self.tree[i] += x i += i & -i class RangeUpdate: def __init__(self, n): self.p = Bit(n + 1) self.q = Bit(n + 1) def add(self, s, t, x): t += 1 self.p.add(s, -x * s) self.p.add(t, x * t) self.q.add(s, x) self.q.add(t, -x) def sum(self, s, t): t += 1 return self.p.sum(t) + self.q.sum(t) * t - \ self.p.sum(s) - self.q.sum(s) * s #yukicoder218B n,q = map(int,input().split()) a = [int(i) for i in input().split()] cxy = [input().split() for j in range(q)] ru = RangeUpdate(n+1) add = [] for i in range(q): c,x,y = cxy[i] x,y = int(x),int(y) if c == "A": tmp = ru.sum(x,x) add.append([x,y,tmp]) else: ru.add(x,y,1) b = [0]*n for i in range(n): b[i] = ru.sum(i+1,i+1)*a[i] for i in range(len(add)): x,y,tmp = add[i] b[x-1] += y*(ru.sum(x,x)-tmp) print(*b)