#include <bits/stdc++.h> using namespace std; int n, m; int main() { cin >> n >> m; vector<long long> dp(n + 1); vector<int> a(n + 10); for (int i = 0; i < n; i++) cin >> a[i]; for (int j = 0; j < m; j++) { int l, r, k; cin >> l >> r >> k; dp[l - 1] += k; //题目数组索引从 1开始,所以-1, dp[r] -= k; } long long ans = 0; for (int i = 0; i < n; i++) { ans += dp[i]; cout << ans + a[i] << " "; } return 0; }