#include<iostream>
using namespace std;
const int N = 1e5+5;
int a[N],d[N];
int n,m,l,r,c;
int main()
{
cin>>n>>m;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++) d[i]=a[i]-a[i-1];
while(m--)
{
cin>>l>>r>>c;
//d[l]=a[l]-a[l-1];
d[l]+=c;
//d[r+1]=a[r+1]-a[r];
d[r+1]-=c;
}
for(int i=1;i<=n;i++)
{
//d[i]=a[i]−a[i−1]
//a[i]=a[i−1]+d[i]
a[i]=d[i]+a[i-1];
cout<<a[i]<<" ";
}
return 0;
}