#include <iostream>
using namespace std;

int main() {
    int n = 0;
    int m = 0;
    cin >> n >> m;
    long long arr[n];
    long long ar[n];
    for (int i = 0; i < n && cin >> arr[i]; i++);

    ar[0] = 0;
    for (int i = 1; i < n; i++)
    {
        ar[i] = arr[i] - arr[i-1];
    }
    int l = 0;
    int r = 0;
    long long k = 0;

    for (int i = 0; i < m && cin >> l >> r >> k; i++)
    {
        ar[l-1] += k;
        if (r < n)
		{
		  ar[r] -= k;
		}
    }
    arr[0] += ar[0]; 
    for (int i = 1; i < n; i++)
    {
        arr[i] = ar[i] + arr[i-1];
    }
    for (int i = 0; i < n; i++)
    {
        cout << arr[i] <<' ';
    }
    return 0;
}