class Bit: def __init__(self, n): self.size = n self.n0 = 1 << (n.bit_length() - 1) self.tree = [0] * (n + 1) def range_sum(self, l, r): return self.sum(r - 1) - self.sum(l - 1) def sum(self, i): i += 1 s = 0 while i > 0: s += self.tree[i] i -= i & -i return s def get(self, i): return self.sum(i) - self.sum(i - 1) def add(self, i, x): i += 1 while i <= self.size: self.tree[i] += x i += i & -i def lower_bound(self, x): pos = 0 plus = self.n0 while plus > 0: if pos + plus <= self.size and self.tree[pos + plus] < x: x -= self.tree[pos + plus] pos += plus plus //= 2 return pos n, Q = map(int, input().split()) A = list(map(int, input().split())) bit = Bit(n + 1) ans = [0] * n for _ in range(Q): query = input().split() if query[0] == "A": x, y = map(int, query[1:]) x -= 1 c = bit.sum(x) ans[x] += c * A[x] A[x] += y bit.add(x, -c) bit.add(x + 1, c) else: x, y = map(int, query[1:]) bit.add(x - 1, 1) bit.add(y, -1) for i in range(n): ans[i] += bit.sum(i) * A[i] print(*ans)