#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 +7;
int arr[N],diff[N];
void solve(int n,int m){
for(int i=1;i<=n;i++) cin >> arr[i];
for(int i=1;i<=n;i++) diff[i] = arr[i] - arr[i-1];
while(m--){
int x,y,z;cin >> x >> y >> z;
diff[x] += z,diff[y+1] -= z;
}
for(int i=1;i<=n;i++) arr[i] = arr[i-1] + diff[i];
for(int i=1;i<=n;i++) cout << arr[i] << ' ';
cout << endl;
}
int main()
{
int n,m;
while(cin >> n >> m) solve(n,m);
return 0;
}