n, m = map(int,input().split())
a = list(map(int,input().split()))

b = [0]*(n+1)#计算差量数组
for _ in range(m):
    l, r, k = map(int,input().split())
    b[l-1] += k
    if r<n:
        b[r] -= k

cur = 0#基于差量数组,计算差分数组
for i in range(n):
    cur += b[i]
    a[i] += cur

print(' '.join(map(str,a)))#输出差分数组