include [HTML_REMOVED]
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N];
int m, n;
int main()
{
scanf(“%d%d”, &n, &m);
for(int i = 1; i <= n; i++ )
{
scanf(“%d”, &a[i]);
b[i] = a[i] - a[i -1];
}
int l, r, c;
while(m --)
{
scanf("%d%d%d", &l, &r, &c);
b[l] += c;
b[r + 1] -= c;
}
for(int i = 1; i <= n; i++)
{
a[i] = a[i - 1] + b[i];
printf("%d ", a[i]);
}
return 0;
}