#include <bits/stdc++.h>
using namespace std;
const int N=100010;
int a[N],b[N];
int main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++)
{
cin>>a[i];
b[i]=a[i]-a[i-1];
}
int l,r,c;
while(m--)
{
cin>>l>>r>>c;
b[l]+=c;
b[r+1]-=c;
}
for(int i=1;i<=n;i++)
{
b[i]+=b[i-1];
cout<<b[i]<<" ";
}
return 0;
}