#include <iostream>
#include <cstdio>
using namespace std;
const int N = 1e5 + 5;
int arr[N];
int main()
{
int n, m;
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; ++i)
{
int tmp;
scanf("%d", &tmp);
arr[i] += tmp, arr[i+1] -= tmp;
}
while (m--)
{
int l, r, c;
scanf("%d %d %d", &l, &r, &c);
arr[l] += c, arr[r+1] -= c;
}
for (int i = 1; i <= n; ++i)
{
arr[i] += arr[i-1];
printf("%d ", arr[i]);
}
return 0;
}