#include <iostream>
using namespace std;
const int N = 100000+10;
int a[N], b[N];
void insert_(int l, int r, int c) {
b[l] += c;
b[r+1] -= c;
}
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> a[i], insert_(i, i, a[i]);
while(m --) {
int l, r, c;
cin >> l >> r >> c;
insert_(l, r, c);
}
for (int i = 1; i <= n; i++) b[i]+=b[i-1], cout << b[i] << " ";
return 0;
}