INF = 10 ** 7 import sys input = sys.stdin.readline sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from bisect import bisect_left class BinaryIndexedTree(): def __init__(self,init_val): self.bit = [0] + init_val self.n = len(init_val) def sum(self,i): ret = 0 while i > 0: ret += self.bit[i] i -= (i & -i) return ret def add(self,i,x): while i <= self.n: self.bit[i] += x i += (i & -i) def main(): n,q = map(int,input().split()) a = list(map(int,input().split())) b = [0] * n cnt = [0] * n bit = BinaryIndexedTree([0] * n) for _ in range(q): t,x,y = map(str,input().split()) x = int(x) y = int(y) if t == 'A': c = bit.sum(x) b[x - 1] -= c * y a[x - 1] += y else: cnt[x - 1] += 1 bit.add(x,1) if y < n: cnt[y] -= 1 bit.add(y + 1,-1) b[0] += cnt[0] * a[0] for i in range(1,n): cnt[i] += cnt[i - 1] b[i] += cnt[i] * a[i] print(*b) if __name__ == '__main__': main()