#include<bits/stdc++.h>
using namespace std;
int a[1000000],b[100000],l,r,p,n,k;
int main(){
	scanf("%d",&n,&k);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		b[i]=a[i]-a[i-1];
	}
    while(k--){
        scanf("%d%d%d",&l,&r,&p);
        b[l]+=p;
        b[r+1]-=p;
    }
    for(int i=1;i<=n;i++){
    	a[i]=a[i+1]-b[i];
    	printf("%d",&a[i]);
    }
	return 0;
}
/**************************************************************
	Problem: 2062
	User: huangkaiwei
	Language: C++
	Result: Wrong Answer
****************************************************************/