import sys def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] class BitSum: def __init__(self, n): self.n = n + 3 self.table = [0] * (self.n + 1) def add(self, i, x): i += 1 while i <= self.n: self.table[i] += x i += i & -i def sum(self, i): i += 1 res = 0 while i > 0: res += self.table[i] i -= i & -i return res def main(): n,q=MI() aa=LI() cxy=[input().split() for _ in range(q)] bit=BitSum(n+1) bb=[0]*n for c,x,y in cxy[::-1]: x,y=int(x),int(y) if c=="A": x-=1 k=bit.sum(x) bb[x]+=k*y else: x,y=x-1,y-1 bit.add(x,1) bit.add(y+1,-1) for i in range(n): k=bit.sum(i) bb[i]+=k*aa[i] print(*bb) main()