#include <stdio.h>
#define MAX_N 101010
#define ll long long
ll a[MAX_N];
ll dp[MAX_N];

int main() {
    int n, m, i;
    scanf("%d%d", &n, &m);
    for (i = 1; i <= n; i++) {
        scanf("%lld", &a[i]);
    }
    for (i = 1; i <= m; i++) {
        int l, r, x;
        scanf("%d%d%d", &l, &r, &x);
        dp[l] += x;
        if (r + 1 <= n) {
            dp[r + 1] -= x;
        }
    }
    for (i = 1; i <= n; i++) {
        dp[i] += dp[i - 1];
    }
    for (i = 1; i <= n; i++) {
        printf("%lld ", a[i] + dp[i]);
    }
    return 0;
}