#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long a[100005][105];
long long b[100005];
long long C[100005][105];
void init() {
  C[0][0] = 1;
  for (int i = 1; i < 100005; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i && j < 105; ++j)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  }
}
int main() {
  int n, m;
  init();
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%lld", &b[i]);
  memset(a, 0, sizeof(a));
  int l, r, k;
  while (m--) {
    scanf("%d%d%d", &l, &r, &k);
    if (l > r) swap(l, r);
    for (int i = 0; i <= k; ++i) a[l][i] = (a[l][i] + C[k][k - i]) % MOD;
    for (int i = 0; i <= k; ++i)
      a[r + 1][i] = (a[r + 1][i] - C[k + r - l + 1][k - i] + MOD) % MOD;
  }
  b[1] = ((b[1] + a[1][0]) % MOD + MOD) % MOD;
  for (int i = 2; i <= n; ++i) {
    for (int k = 0; k < 101; ++k)
      a[i][k] = (a[i][k] + (a[i - 1][k] + a[i - 1][k + 1]) % MOD) % MOD;
    b[i] = ((b[i] + a[i][0]) % MOD + MOD) % MOD;
  }
  printf("%lld", b[1]);
  for (int i = 2; i <= n; ++i) printf(" %lld", b[i]);
  puts("");
  return 0;
}
