import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ class Binary_Indexed_Tree_RAQ(): def __init__(self, n): self.data = [0]*(n+1) self.n = n+1 def __add(self, ind, num): while(ind <= self.n): self.data[ind - 1] += num ind += ind & -ind # [s, t] def range_add(self, s, t, x): s += 1 t += 1 self.__add(s,x) self.__add(t+1,-x) # [0, i] def query(self, i): i += 1 ret = 0 while(i > 0): ret += self.data[i-1] i -= i & -i return ret n,q = map(int, input().split()) a = list(map(int, input().split())) cxy = [input().split() for i in range(q)] b = [0]*n BIT = Binary_Indexed_Tree_RAQ(n) for c,x,y in reversed(cxy): x,y = int(x)-1, int(y) if c == "A": b[x] += BIT.query(x)*y else: BIT.range_add(x, y-1, 1) for i in range(n): b[i] += BIT.query(i)*a[i] print(*b)