#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cassert>
#include <climits>

using namespace std;

#define spc        printf(" ")
#define nln        puts("")                         ///printnewline
#define Max(a,b,c) max(a,max(b,c))                  ///3 ta theke max
#define Min(a,b,c) min(a,min(b,c))                  ///3 ta theke min
#define sqr(x)     (x)*(x)

#define z(x)       fabs(x)<EPS
#define iqu(x,y)   z(fabs(x-y))

#define rep(i,a,b)  for(i=a;i<=b;i++)
#define rep0(i,n)   for(i=0;i<n;i++)
#define rep1(i,n)   for(i=1;i<=n;i++)               ///looping
#define rev(i,a,b)  for(i=a;i>=b;i--)
#define rev0(i,n)   for(i=n-1;i>=0;i--)
#define rev1(i,n)   for(i=n;i>=1;i--)
#define forstl(i,v) for(i=0;i<v.size();i++)
#define forit(it,v)    for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define all(p)      p.begin(),p.end()

#define SET(p)     memset(p,-1,sizeof(p))
#define CLR(p)     memset(p,0,sizeof(p))            ///memset
#define MEM(p,v)   memset(p,v,sizeof(p))

#define READ(f)    freopen(f, "r", stdin)           /// file
#define WRITE(f)   freopen(f, "w", stdout)

#define vi         vector<int>
#define vll        vector<long long>
#define vs         vector<string>
#define pii        pair<int,int>
#define pll        pair<long long,long long>
#define sz(c)      (int)c.size()
#define pb(x)      push_back(x)                     ///STL defines
#define mp(x,y)    make_pair(x,y)
#define xx         first
#define yy         second
#define _itr(v)    __typeof(v.begin())

#define LLI        long long int
#define i64        long long int
#define i64u       unsigned long long int
#define LLU        unsigned long long int
#define Double     long double
#define PI         acos(-1.0)                        ///PI er value

#define check(n, pos)  (bool)(n & (1LL<<(pos)))      ///CHECK
#define biton(n, pos)  (n | (1LL<<(pos)))            ///ON     }-bit opr.
#define bitoff(n, pos) (n & ~(1LL<<(pos)))           ///OFF

// reading and writing case
#define readcase  int cas,kase=0;CI(cas);while((cas--)&&(++kase))
#define printcase printf("Case %d:",kase)

//debugging infinite variable
bool deb_mode = 0;
#define debug(a...)     if(deb_mode){cout<<"Line= "<<__LINE__<<" -> ";Dbug,a,#a;Dbug.printall();cout<<endl;}
class debugger {
    vector<string> vars;
public:
    template<typename T> debugger& operator , ( const T v ) { stringstream ss; ss << v, vars.push_back( ss.str() ); return *this; }
    void printall() { int j = 0, l = vars.size(); for( int i = 0; i < ( l - 1 ); i++ ) { if( i )cout << ", "; for( j; j < vars[l - 1].size(); j++ ) { if( vars[l - 1][j] == ',' ) {j++; break;} cout << vars[l - 1][j]; } cout << " = " << vars[i]; } vars.clear(); }
} Dbug;

///STL printing output stream overloading
template <typename T1, typename T2> inline ostream& operator << ( ostream& os, const pair<T1, T2>& p ) { return os << "(" << p.first << "," << p.second << ")"; }
template <typename T> inline ostream &operator << ( ostream & os, const vector<T>& v ) { bool first = true; os << "{"; for( unsigned int i = 0; i < v.size(); i++ ) { if( !first ) os << ","; os << v[i]; first = false; } return os << "}"; }
template <typename T> inline ostream &operator << (  ostream & os, const set<T>& v ) { bool first = true; os << "{"; for ( typename set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii; first = false; } return os << "}"; }
template <typename T1, typename T2> inline ostream &operator << ( ostream & os, const map<T1, T2>& v ) { bool first = true; os << "{"; for ( typename map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii ; first = false; } return os << "}"; }

template <typename T> void getarray( T a[], int b, int e ) { for( int i = b; i < e + b; i++ ) cin >> a[i]; }
template <typename T> void printarray( T a[], int b, int e ) { for( int i = b; i < e - 1 + b; i++ ) cout << a[i] << " "; if( e - 1 + b >= 0 ) cout << a[e - 1 + b] << endl; }
template <typename T> void printV( vector<T> v ) { int sz = v.size(); if( sz ) cout << v[0]; for( int i = 1; i < sz; i++ ) cout << " " << v[i]; nln; }

template <typename T> T gcd( T a, T b ) { if( b == 0 ) return a; return gcd( b, a % b ); }
template <typename T> T BigMod ( T b, T p, T m ) { if ( p == 0 ) return 1; if ( p % 2 == 0 ) { T s = BigMod( b, p / 2, m ); return ( ( s % m ) * ( s % m ) ) % m; } return ( ( b % m ) * ( BigMod( b, p - 1, m ) % m ) ) % m; }
template <typename T> T ModInv ( T b, T m ) { return BigMod( b, m - 2, m ); }

template<class T> inline void read( T &x ) { bool Minus = 0; char c; for( c = getchar(); c <= 32; c = getchar() ) ; if( c == '-' ) Minus = 1, c = getchar(); for( x = 0; c > 32; c = getchar() ) x = x * 10 + c - '0'; if( Minus ) x = -x; }
char getc() { char c; for( c = getchar(); c <= 32; c = getchar() ); return c; }  ///input char with buffering
int CI( int &_x ) { return scanf( "%d", &_x ); }
int CI( int &_x, int &_y ) { return scanf( "%d %d", &_x, &_y ); }
int CI( int &_x, int &_y, int &_z ) { return scanf( "%d %d %d", &_x, &_y, &_z ); }
int CI( int &_a, int &_b, int &_c, int &_d ) { return scanf( "%d %d %d %d", &_a, &_b, &_c, &_d ); }

template <class T> string toString( T n ) { ostringstream oss; oss << n; return oss.str(); }
int toInt( string s ) { int r = 0; istringstream sin( s ); sin >> r; return r; }
i64 toLong( string s ) { i64 r = 0; istringstream sin( s ); sin >> r; return r; }
bool isVowel( char ch ) { ch = tolower( ch ); if( ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )return true; return false; }
bool isUpper( char c ) { return c >= 'A' && c <= 'Z'; }
bool isLower( char c ) { return c >= 'a' && c <= 'z'; }

int dr8[8] = { +1, -1, +0, +0, +1, -1, -1, +1};   ///8 direction move
int dc8[8] = { +0, +0, -1, +1, +1, +1, -1, -1};
int dr4[4] = { +0, +0, +1, -1};                   ///4 direction move
int dc4[4] = { -1, +1, +0, +0};                   ///or adjacent dir.
int kn8r[8] = { +1, +2, +2, +1, -1, -2, -2, -1};  ///knight moves
int kn8c[8] = { +2, +1, -1, -2, -2, -1, +1, +2};

const double EPS = 1e-9;                         ///constants
const int INF = ( 1 << 30 ) - 1;
const i64 LINF = ( 1ll << 62 ) - 1;
const int mod = ( int )1e9 + 7;
const int MAX = ( int )1e5;
///____________________________Main Coding Starts From Here________________________///

i64 fact[MAX + 7];
i64 inv[MAX + 7];
i64 partial_pascal[111][MAX + 7];

void Hmm() {
    fact[0] = 1LL;
    inv[0] = ModInv( fact[0], ( i64 )mod );
    for( int i = 1; i <= MAX; i++ ) {
        fact[i] = ( fact[i - 1] * i ) % mod;
        inv[i] = ModInv( fact[i], ( i64 )mod );
    }
}

i64 nCr( int n, int c ) {
    return ( ( ( fact[n] * inv[c] ) % mod ) * inv[n - c] ) % mod;
}

int main() {
#ifndef ONLINE_JUDGE
    READ( "/home/sonjoy/Desktop/in.txt" );
//    WRITE("out.txt");
    deb_mode = 1;
#endif
    if( deb_mode )
        srand( int( time( NULL ) ) );

    int i, j, k, l, r, n, m, q, a, b, c;
    int ar[MAX + 7];

    CI( n, q );
    rep1( i, n )CI( ar[i] );
    Hmm();
    while( q-- ) {
        CI( l, r, k );
        partial_pascal[k][l] += 1LL;
        for( i = k; i >= 0; i-- ) {
            partial_pascal[i][r + 1] = ( partial_pascal[i][r + 1] - nCr( r - l  + k - i, k - i ) + mod ) % mod;
        }
    }

    for( i = 100; i >= 0; i-- ) {
        for( j = 1; j <= n; j++ ) {
            partial_pascal[i][j] = ( partial_pascal[i][j] + partial_pascal[i + 1][j] + partial_pascal[i][j - 1] + mod ) % mod;
        }
    }

    rep1( i, n ) {
        cout << ( ar[i] + partial_pascal[0][i] ) % mod << " ";
    }

    if( deb_mode )
        cerr << "TIME = " << clock() << " ms" << endl;
    return 0;
}


#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cassert>
#include <climits>

using namespace std;

#define spc        printf(" ")
#define nln        puts("")                         ///printnewline
#define Max(a,b,c) max(a,max(b,c))                  ///3 ta theke max
#define Min(a,b,c) min(a,min(b,c))                  ///3 ta theke min
#define sqr(x)     (x)*(x)

#define z(x)       fabs(x)<EPS
#define iqu(x,y)   z(fabs(x-y))

#define rep(i,a,b)  for(i=a;i<=b;i++)
#define rep0(i,n)   for(i=0;i<n;i++)
#define rep1(i,n)   for(i=1;i<=n;i++)               ///looping
#define rev(i,a,b)  for(i=a;i>=b;i--)
#define rev0(i,n)   for(i=n-1;i>=0;i--)
#define rev1(i,n)   for(i=n;i>=1;i--)
#define forstl(i,v) for(i=0;i<v.size();i++)
#define forit(it,v)    for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define all(p)      p.begin(),p.end()

#define SET(p)     memset(p,-1,sizeof(p))
#define CLR(p)     memset(p,0,sizeof(p))            ///memset
#define MEM(p,v)   memset(p,v,sizeof(p))

#define READ(f)    freopen(f, "r", stdin)           /// file
#define WRITE(f)   freopen(f, "w", stdout)

#define vi         vector<int>
#define vll        vector<long long>
#define vs         vector<string>
#define pii        pair<int,int>
#define pll        pair<long long,long long>
#define sz(c)      (int)c.size()
#define pb(x)      push_back(x)                     ///STL defines
#define mp(x,y)    make_pair(x,y)
#define xx         first
#define yy         second
#define _itr(v)    __typeof(v.begin())

#define LLI        long long int
#define i64        long long int
#define i64u       unsigned long long int
#define LLU        unsigned long long int
#define Double     long double
#define PI         acos(-1.0)                        ///PI er value

#define check(n, pos)  (bool)(n & (1LL<<(pos)))      ///CHECK
#define biton(n, pos)  (n | (1LL<<(pos)))            ///ON     }-bit opr.
#define bitoff(n, pos) (n & ~(1LL<<(pos)))           ///OFF

// reading and writing case
#define readcase  int cas,kase=0;CI(cas);while((cas--)&&(++kase))
#define printcase printf("Case %d:",kase)

//debugging infinite variable
bool deb_mode = 0;
#define debug(a...)     if(deb_mode){cout<<"Line= "<<__LINE__<<" -> ";Dbug,a,#a;Dbug.printall();cout<<endl;}
class debugger {
    vector<string> vars;
public:
    template<typename T> debugger& operator , ( const T v ) { stringstream ss; ss << v, vars.push_back( ss.str() ); return *this; }
    void printall() { int j = 0, l = vars.size(); for( int i = 0; i < ( l - 1 ); i++ ) { if( i )cout << ", "; for( j; j < vars[l - 1].size(); j++ ) { if( vars[l - 1][j] == ',' ) {j++; break;} cout << vars[l - 1][j]; } cout << " = " << vars[i]; } vars.clear(); }
} Dbug;

///STL printing output stream overloading
template <typename T1, typename T2> inline ostream& operator << ( ostream& os, const pair<T1, T2>& p ) { return os << "(" << p.first << "," << p.second << ")"; }
template <typename T> inline ostream &operator << ( ostream & os, const vector<T>& v ) { bool first = true; os << "{"; for( unsigned int i = 0; i < v.size(); i++ ) { if( !first ) os << ","; os << v[i]; first = false; } return os << "}"; }
template <typename T> inline ostream &operator << (  ostream & os, const set<T>& v ) { bool first = true; os << "{"; for ( typename set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii; first = false; } return os << "}"; }
template <typename T1, typename T2> inline ostream &operator << ( ostream & os, const map<T1, T2>& v ) { bool first = true; os << "{"; for ( typename map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii ; first = false; } return os << "}"; }

template <typename T> void getarray( T a[], int b, int e ) { for( int i = b; i < e + b; i++ ) cin >> a[i]; }
template <typename T> void printarray( T a[], int b, int e ) { for( int i = b; i < e - 1 + b; i++ ) cout << a[i] << " "; if( e - 1 + b >= 0 ) cout << a[e - 1 + b] << endl; }
template <typename T> void printV( vector<T> v ) { int sz = v.size(); if( sz ) cout << v[0]; for( int i = 1; i < sz; i++ ) cout << " " << v[i]; nln; }

template <typename T> T gcd( T a, T b ) { if( b == 0 ) return a; return gcd( b, a % b ); }
template <typename T> T BigMod ( T b, T p, T m ) { if ( p == 0 ) return 1; if ( p % 2 == 0 ) { T s = BigMod( b, p / 2, m ); return ( ( s % m ) * ( s % m ) ) % m; } return ( ( b % m ) * ( BigMod( b, p - 1, m ) % m ) ) % m; }
template <typename T> T ModInv ( T b, T m ) { return BigMod( b, m - 2, m ); }

template<class T> inline void read( T &x ) { bool Minus = 0; char c; for( c = getchar(); c <= 32; c = getchar() ) ; if( c == '-' ) Minus = 1, c = getchar(); for( x = 0; c > 32; c = getchar() ) x = x * 10 + c - '0'; if( Minus ) x = -x; }
char getc() { char c; for( c = getchar(); c <= 32; c = getchar() ); return c; }  ///input char with buffering
int CI( int &_x ) { return scanf( "%d", &_x ); }
int CI( int &_x, int &_y ) { return scanf( "%d %d", &_x, &_y ); }
int CI( int &_x, int &_y, int &_z ) { return scanf( "%d %d %d", &_x, &_y, &_z ); }
int CI( int &_a, int &_b, int &_c, int &_d ) { return scanf( "%d %d %d %d", &_a, &_b, &_c, &_d ); }

template <class T> string toString( T n ) { ostringstream oss; oss << n; return oss.str(); }
int toInt( string s ) { int r = 0; istringstream sin( s ); sin >> r; return r; }
i64 toLong( string s ) { i64 r = 0; istringstream sin( s ); sin >> r; return r; }
bool isVowel( char ch ) { ch = tolower( ch ); if( ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )return true; return false; }
bool isUpper( char c ) { return c >= 'A' && c <= 'Z'; }
bool isLower( char c ) { return c >= 'a' && c <= 'z'; }

int dr8[8] = { +1, -1, +0, +0, +1, -1, -1, +1};   ///8 direction move
int dc8[8] = { +0, +0, -1, +1, +1, +1, -1, -1};
int dr4[4] = { +0, +0, +1, -1};                   ///4 direction move
int dc4[4] = { -1, +1, +0, +0};                   ///or adjacent dir.
int kn8r[8] = { +1, +2, +2, +1, -1, -2, -2, -1};  ///knight moves
int kn8c[8] = { +2, +1, -1, -2, -2, -1, +1, +2};

const double EPS = 1e-9;                         ///constants
const int INF = ( 1 << 30 ) - 1;
const i64 LINF = ( 1ll << 62 ) - 1;
const int mod = ( int )1e9 + 7;
const int MAX = ( int )1e5;
///____________________________Main Coding Starts From Here________________________///

i64 fact[MAX + 7];
i64 inv[MAX + 7];
i64 partial_pascal[111][MAX + 7];

void Hmm() {
    fact[0] = 1LL;
    inv[0] = ModInv( fact[0], ( i64 )mod );
    for( int i = 1; i <= MAX; i++ ) {
        fact[i] = ( fact[i - 1] * i ) % mod;
        inv[i] = ModInv( fact[i], ( i64 )mod );
        //if( i < 11 )debug( i, fact[i], inv[i] );
    }
}

i64 nCr( int n, int c ) {
    return ( ( ( fact[n] * inv[c] ) % mod ) * inv[n - c] ) % mod;
}

int main() {
#ifndef ONLINE_JUDGE
    READ( "/home/sonjoy/Desktop/in.txt" );
//    WRITE("out.txt");
    deb_mode = 1;
#endif
    if( deb_mode )
        srand( int( time( NULL ) ) );

    int i, j, k, l, r, n, m, q, a, b, c;
    Hmm();

    int ar[MAX + 7];
    CI( n, q );
    rep1( i, n )CI( ar[i] );

    while( q-- ) {
        CI( l, r, k );
        partial_pascal[k][l] += 1LL;
        for( i = k; i >= 0; i-- ) {
            int pop = nCr( r - l + k - i, k - i );;
            //debug( i, r - l  + k - i, k - i, pop );
            partial_pascal[i][r + 1] -= nCr( r - l  + k - i, k - i );
        }
    }

//    rep0( i, 15 ) {
//        rep0( j, 15 )
//        cout << "[" << partial_pascal[i][j] << "] ";
//        nln;
//    }
//    nln;
//    nln;
//    nln;

    for( i = 100; i >= 0; i-- ) {
        for( j = 1; j <= n; j++ ) {
            //cout<<"[ "<<partial_pascal[i][j]<<" ";
            partial_pascal[i][j] = ( partial_pascal[i][j] + partial_pascal[i + 1][j] + partial_pascal[i][j - 1] ) % mod;
            //cout<<partial_pascal[i][j]<<" ] ";
        }
//        int ii, jj;
//        rep0( ii, 15 ) {
//            rep0( jj, 15 )
//            cout << "[" << partial_pascal[ii][jj] << "] ";
//            nln;
//        }
    }

//    rep0( i, 15 ) {
//        rep0( j, 15 )
//        cout << "[" << partial_pascal[i][j] << "] ";
//        nln;
//    }

    rep1( i, n ) {
        cout << ( ar[i] + partial_pascal[0][i] ) % mod;
        if( i == n )nln;
        else spc;
    }

    if( deb_mode )
        cerr << "TIME = " << clock() << " ms" << endl;
    return 0;
}


#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cassert>
#include <climits>

using namespace std;

#define spc        printf(" ")
#define nln        puts("")                         ///printnewline
#define Max(a,b,c) max(a,max(b,c))                  ///3 ta theke max
#define Min(a,b,c) min(a,min(b,c))                  ///3 ta theke min
#define sqr(x)     (x)*(x)

#define z(x)       fabs(x)<EPS
#define iqu(x,y)   z(fabs(x-y))

#define rep(i,a,b)  for(i=a;i<=b;i++)
#define rep0(i,n)   for(i=0;i<n;i++)
#define rep1(i,n)   for(i=1;i<=n;i++)               ///looping
#define rev(i,a,b)  for(i=a;i>=b;i--)
#define rev0(i,n)   for(i=n-1;i>=0;i--)
#define rev1(i,n)   for(i=n;i>=1;i--)
#define forstl(i,v) for(i=0;i<v.size();i++)
#define forit(it,v)    for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define all(p)      p.begin(),p.end()

#define SET(p)     memset(p,-1,sizeof(p))
#define CLR(p)     memset(p,0,sizeof(p))            ///memset
#define MEM(p,v)   memset(p,v,sizeof(p))

#define READ(f)    freopen(f, "r", stdin)           /// file
#define WRITE(f)   freopen(f, "w", stdout)

#define vi         vector<int>
#define vll        vector<long long>
#define vs         vector<string>
#define pii        pair<int,int>
#define pll        pair<long long,long long>
#define sz(c)      (int)c.size()
#define pb(x)      push_back(x)                     ///STL defines
#define mp(x,y)    make_pair(x,y)
#define xx         first
#define yy         second
#define _itr(v)    __typeof(v.begin())

#define LLI        long long int
#define i64        long long int
#define i64u       unsigned long long int
#define LLU        unsigned long long int
#define Double     long double
#define PI         acos(-1.0)                        ///PI er value

#define check(n, pos)  (bool)(n & (1LL<<(pos)))      ///CHECK
#define biton(n, pos)  (n | (1LL<<(pos)))            ///ON     }-bit opr.
#define bitoff(n, pos) (n & ~(1LL<<(pos)))           ///OFF

// reading and writing case
#define readcase  int cas,kase=0;CI(cas);while((cas--)&&(++kase))
#define printcase printf("Case %d:",kase)

//debugging infinite variable
bool deb_mode = 0;
#define debug(a...)     if(deb_mode){cout<<"Line= "<<__LINE__<<" -> ";Dbug,a,#a;Dbug.printall();cout<<endl;}
class debugger {
    vector<string> vars;
public:
    template<typename T> debugger& operator , ( const T v ) { stringstream ss; ss << v, vars.push_back( ss.str() ); return *this; }
    void printall() { int j = 0, l = vars.size(); for( int i = 0; i < ( l - 1 ); i++ ) { if( i )cout << ", "; for( j; j < vars[l - 1].size(); j++ ) { if( vars[l - 1][j] == ',' ) {j++; break;} cout << vars[l - 1][j]; } cout << " = " << vars[i]; } vars.clear(); }
} Dbug;

///STL printing output stream overloading
template <typename T1, typename T2> inline ostream& operator << ( ostream& os, const pair<T1, T2>& p ) { return os << "(" << p.first << "," << p.second << ")"; }
template <typename T> inline ostream &operator << ( ostream & os, const vector<T>& v ) { bool first = true; os << "{"; for( unsigned int i = 0; i < v.size(); i++ ) { if( !first ) os << ","; os << v[i]; first = false; } return os << "}"; }
template <typename T> inline ostream &operator << (  ostream & os, const set<T>& v ) { bool first = true; os << "{"; for ( typename set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii; first = false; } return os << "}"; }
template <typename T1, typename T2> inline ostream &operator << ( ostream & os, const map<T1, T2>& v ) { bool first = true; os << "{"; for ( typename map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii ) { if( !first ) os << ","; os << *ii ; first = false; } return os << "}"; }

template <typename T> void getarray( T a[], int b, int e ) { for( int i = b; i < e + b; i++ ) cin >> a[i]; }
template <typename T> void printarray( T a[], int b, int e ) { for( int i = b; i < e - 1 + b; i++ ) cout << a[i] << " "; if( e - 1 + b >= 0 ) cout << a[e - 1 + b] << endl; }
template <typename T> void printV( vector<T> v ) { int sz = v.size(); if( sz ) cout << v[0]; for( int i = 1; i < sz; i++ ) cout << " " << v[i]; nln; }

template <typename T> T gcd( T a, T b ) { if( b == 0 ) return a; return gcd( b, a % b ); }
template <typename T> T BigMod ( T b, T p, T m ) { if ( p == 0 ) return 1; if ( p % 2 == 0 ) { T s = BigMod( b, p / 2, m ); return ( ( s % m ) * ( s % m ) ) % m; } return ( ( b % m ) * ( BigMod( b, p - 1, m ) % m ) ) % m; }
template <typename T> T ModInv ( T b, T m ) { return BigMod( b, m - 2, m ); }

template<class T> inline void read( T &x ) { bool Minus = 0; char c; for( c = getchar(); c <= 32; c = getchar() ) ; if( c == '-' ) Minus = 1, c = getchar(); for( x = 0; c > 32; c = getchar() ) x = x * 10 + c - '0'; if( Minus ) x = -x; }
char getc() { char c; for( c = getchar(); c <= 32; c = getchar() ); return c; }  ///input char with buffering
int CI( int &_x ) { return scanf( "%d", &_x ); }
int CI( int &_x, int &_y ) { return scanf( "%d %d", &_x, &_y ); }
int CI( int &_x, int &_y, int &_z ) { return scanf( "%d %d %d", &_x, &_y, &_z ); }
int CI( int &_a, int &_b, int &_c, int &_d ) { return scanf( "%d %d %d %d", &_a, &_b, &_c, &_d ); }

template <class T> string toString( T n ) { ostringstream oss; oss << n; return oss.str(); }
int toInt( string s ) { int r = 0; istringstream sin( s ); sin >> r; return r; }
i64 toLong( string s ) { i64 r = 0; istringstream sin( s ); sin >> r; return r; }
bool isVowel( char ch ) { ch = tolower( ch ); if( ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )return true; return false; }
bool isUpper( char c ) { return c >= 'A' && c <= 'Z'; }
bool isLower( char c ) { return c >= 'a' && c <= 'z'; }

int dr8[8] = { +1, -1, +0, +0, +1, -1, -1, +1};   ///8 direction move
int dc8[8] = { +0, +0, -1, +1, +1, +1, -1, -1};
int dr4[4] = { +0, +0, +1, -1};                   ///4 direction move
int dc4[4] = { -1, +1, +0, +0};                   ///or adjacent dir.
int kn8r[8] = { +1, +2, +2, +1, -1, -2, -2, -1};  ///knight moves
int kn8c[8] = { +2, +1, -1, -2, -2, -1, +1, +2};

const double EPS = 1e-9;                         ///constants
const int INF = ( 1 << 30 ) - 1;
const i64 LINF = ( 1ll << 62 ) - 1;
const int mod = ( int )1e9 + 7;
const int MAX = ( int )1e5;
///____________________________Main Coding Starts From Here________________________///

i64 fact[MAX + 7];
i64 inv[MAX + 7];
i64 partial_pascal[111][MAX + 7];

void Hmm() {
    fact[0] = 1LL;
    inv[0] = ModInv( fact[0], ( i64 )mod );
    for( int i = 1; i <= MAX; i++ ) {
        fact[i] = ( fact[i - 1] * i ) % mod;
        inv[i] = ModInv( fact[i], ( i64 )mod );
        //if( i < 11 )debug( i, fact[i], inv[i] );
    }
}

i64 nCr( int n, int c ) {
    return ( ( ( fact[n] * inv[c] ) % mod ) * inv[n - c] ) % mod;
}

int main() {
#ifndef ONLINE_JUDGE
    READ( "/home/sonjoy/Desktop/in.txt" );
//    WRITE("out.txt");
    deb_mode = 1;
#endif
    if( deb_mode )
        srand( int( time( NULL ) ) );

    int i, j, k, l, r, n, m, q, a, b, c;
    Hmm();

    int ar[MAX + 7];
    CI( n, q );
    rep1( i, n )CI( ar[i] );

    while( q-- ) {
        CI( l, r, k );
        partial_pascal[k][l] = 1LL;
        for( i = k; i >= 0; i-- ) {
            int pop = nCr( r - l + k - i, k - i );;
            //debug( i, r - l  + k - i, k - i, pop );
            partial_pascal[i][r + 1] -= nCr( r - l  + k - i, k - i );
        }
    }

//    rep0( i, 15 ) {
//        rep0( j, 15 )
//        cout << "[" << partial_pascal[i][j] << "] ";
//        nln;
//    }
//    nln;
//    nln;
//    nln;

    for( i = 100; i >= 0; i-- ) {
        for( j = 1; j <= n; j++ ) {
            //cout<<"[ "<<partial_pascal[i][j]<<" ";
            partial_pascal[i][j] = ( partial_pascal[i][j] + partial_pascal[i + 1][j] + partial_pascal[i][j - 1] ) % mod;
            //cout<<partial_pascal[i][j]<<" ] ";
        }
//        int ii, jj;
//        rep0( ii, 15 ) {
//            rep0( jj, 15 )
//            cout << "[" << partial_pascal[ii][jj] << "] ";
//            nln;
//        }
    }

//    rep0( i, 15 ) {
//        rep0( j, 15 )
//        cout << "[" << partial_pascal[i][j] << "] ";
//        nln;
//    }

    rep1( i, n ) {
        cout << ( ar[i] + partial_pascal[0][i] ) % mod;
        if( i == n )nln;
        else spc;
    }

    if( deb_mode )
        cerr << "TIME = " << clock() << " ms" << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 3; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN + 110][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0] + MOD) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN];
long long C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i]) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0] + MOD) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))
typedef long long lld;

int n, m;
int a[MAXN];
lld C[MAXN + 110][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r][i] = (diff[r][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))
typedef long long lld;

int n, m;
int a[MAXN];
int C[MAXN + 110][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = ((diff[i][j] + diff[i - 1][j]) % MOD + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN + 110][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define MOD 1000000007
#define min(a, b) ((a) < (b) ? (a) : (b))

int n, m;
int a[MAXN], C[MAXN][110], diff[MAXN][110];

int main() {
//freopen("in.txt", "r", stdin);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
	C[0][0] = C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= n + 100; i++) {
		C[i][0] = 1;
		for(int j = 1, end = min(i + 1, 110); j < end; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}

	for(int i = 0; i <= n; i++)
        for(int j = 0; j < 110; j++) diff[i][j] = 0;

	while(m--) {
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for(int i = 0; i <= k; i++) diff[l][i] = (diff[l][i] + C[k][k - i]) % MOD;
		for(int i = 0; i <= k; i++) diff[r + 1][i] = (diff[r + 1][i] - C[r - l + 1 + k][k - i] + MOD) % MOD;
	}

	for(int i = 1; i <= n; i++)
		for(int j = 100; j >= 0; j--)
			diff[i][j] = (diff[i][j] + diff[i - 1][j] + diff[i - 1][j + 1]) % MOD;

    for(int i = 1; i <= n; i++) {
		a[i] = (a[i] + diff[i][0]) % MOD;
		printf("%d ", a[i]);
	}

    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
long long sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	int sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	int sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
long long a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
long long a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n - 1) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
int a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
long long sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[100001][101];
long long a[100001];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200001];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 100000; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		for (int j = 0; j <= min(k, r - l); j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		sum[k] += c[query[head].n][k] * query[head].symbol;
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 0; i < n; i++)
	{
		printf("%d", a[i]);
		if (i != n - 1) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
int a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
int sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
    ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
int sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[k - i] += c[query[head].n - i][k - i];
else diff[k - i] -= c[query[head].n - i][k - i];
if (diff[k - i] >= mod) diff[k - i] -= mod;
			if (diff[i] < 0) diff[k - i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
    ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
long long a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
long long mod = 1e9 + 7;
long long c[101011][101];
long long a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		int l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	long long sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	int sum[101], diff[101];
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
	long long sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
long long sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[201011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
int sum[101], diff[101];
struct Node
{
	int n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int mod = 1e9 + 7;
int c[101011][101];
int a[101011];
long long sum[101], diff[101];
struct Node
{
	long long n, symbol, k, pos;
	bool operator<(Node b) const
	{
		return pos < b.pos;
	}
} query[200011];

class Solution
{
public:
void init()
{
	c[0][0] = 1;
	for (int i = 1; i <= 101010; i++)
		for (int j = 0; j <= 100; j++)
		{
			c[i][j] = c[i - 1][j];
			if (j > 0) c[i][j] += c[i - 1][j - 1];
			if (c[i][j] >= mod) c[i][j] -=mod;
		}
}

void GetAns(int n, int m)
{
int tot = 0;
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
	{
		long long l, r, k;
		scanf("%d%d%d", &l, &r, &k);
		int up = min(k, r - l);
		for (int j = 0; j <= up; j++)
		{
			a[l + j] += c[k + j][k];
			if (a[l + j] >= mod) a[l + j] -= mod;
		}
		if (r - l > k)
		{
			query[tot].n = k + 1;
			query[tot].k = k;
			query[tot].symbol = 1;
			query[tot++].pos = l + k + 1;

			query[tot].n = r - l +  k + 1;
			query[tot].k = k;
			query[tot].symbol = -1;
			query[tot++].pos = r + 1;
		}
	}
	sort(query, query + tot);
	for (int i = 0; i < 101; i++) sum[i] = diff[i] = 0;
int head = 0;
for (int j = 1; j <= n; j++)
{
	for (int i = 1; i <= 100; i++)
	{
		sum[i] = sum[i] + diff[i - 1] - sum[i - 1];
		if (sum[i] >= mod) sum[i] -= mod;
		if (sum[i] < 0) sum[i] += mod;
		diff[i] = diff[i] + diff[i - 1] - sum[i - 1];
		if (diff[i] >= mod) diff[i] -= mod;
		if (diff[i] < 0) diff[i] += mod;
	}
	while ((head < tot) && (query[head].pos == j))
	{
		int k = query[head].k;
		//sum[k] += c[query[head].n][k] * query[head].symbol;
if (query[head].symbol > 0) sum[k] += c[query[head].n][k];
else sum[k] -= c[query[head].n][k];
if (sum[k] >= mod) sum[k] -= mod;
		if (sum[k] < 0) sum[k] += mod;
		for (int i = 0; i <= k; i++)
		{
			//diff[i] += c[query[head].n - i][k - i] * query[head].symbol;
if (query[head].symbol > 0) diff[i] += c[query[head].n - i][k - i];
else diff[i] -= c[query[head].n - i][k - i];
if (diff[i] >= mod) diff[i] -= mod;
			if (diff[i] < 0) diff[i] += mod;
		}
		head++;
	}
	for (int i = 0; i <= 100; i++)
	{
		a[j] += sum[i];
		if (a[j] >= mod) a[j] -= mod;
		//if (a[j] < 0) a[j] += mod;
	}
}

	for (int i = 1; i <= n; i++)
	{
		printf("%d", a[i]);
		if (i != n) printf(" "); else printf("\n");
	}
}
};

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	Solution ans;ans.init();
ans.GetAns(n, m);
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <queue>
#include <iomanip>

using namespace std ;

#define FOREACH(it,c) for( __typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define REP(i,n) FOR(i,0,(n)-1)
#define DEP(i,n) DOW(i,(n)-1,0)
#define all(a) (a).begin() , (a).end()
#define mp(a,b) make_pair((a),(b))
#define RESET(c,x) memset (c, x, sizeof (c))
#define oo 1000111000
#define PI acos(-1.0)
#define fi first
#define se second
#define SIZE(c) (c).size()

typedef vector<int> VI ;
typedef vector<string> VS ;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;

template<class T> inline int size(const T&c) { return c.size(); }

using namespace std;
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

const int maxn = 100200+10;
const int cmod = 1000000007;
int b[maxn];
long long C[maxn][110];
long long a[maxn][110];
int n,m,l,r,k;
int main()
{
    //freopen("C407.inp","r",stdin);
    //freopen("C407.out","w",stdout);
    scanf("%d%d",&n,&m);
    for (int i = 1; i <= n; i++) scanf("%d",&b[i]);
    memset(C,0,sizeof(C));
    memset(a,0,sizeof(a));
    C[0][0] = 1;
    for (int i = 1; i <= 100200; i++)
    {
        C[i][0] = 1;
        for (int j = 1; j <= 100; j++)
            C[i][j] = (C[i-1][j] + C[i-1][j-1])% cmod;
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d%d%d",&l,&r,&k);
        a[l][k] = (a[l][k] + 1) % cmod;
        for (int j = 0; j <= k; j++)
            a[r+1][k - j] = (a[r+1][k - j] - C[r - l + j][j]) % cmod;
    }

    for (int j = 100; j >= 0; j--){
            for (int i = 1; i <= n; i++)
                {
                a[i][j] = ((a[i-1][j] + a[i][j+1]) % cmod + a[i][j]) % cmod;
                    //cout<<a[i][j];
                }
                //cout<<endl;
    }
    for (int i = 1; i <= n; i++)
        printf("%d ",((a[i][0] + b[i])  % cmod + cmod ) % cmod);
    //1 1 1 1 -1
    //1 2 3 4
    //1 3 6 10
    fclose(stdin);
    fclose(stdout);
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <queue>
#include <iomanip>

using namespace std ;

#define FOREACH(it,c) for( __typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define REP(i,n) FOR(i,0,(n)-1)
#define DEP(i,n) DOW(i,(n)-1,0)
#define all(a) (a).begin() , (a).end()
#define mp(a,b) make_pair((a),(b))
#define RESET(c,x) memset (c, x, sizeof (c))
#define oo 1000111000
#define PI acos(-1.0)
#define fi first
#define se second
#define SIZE(c) (c).size()

typedef vector<int> VI ;
typedef vector<string> VS ;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;

template<class T> inline int size(const T&c) { return c.size(); }

using namespace std;
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

const int maxn = 100000+10;
int b[maxn];
int C[maxn][110];
int a[maxn][110];
int n,m,l,r,k;
int main()
{
    //freopen("C407.inp","r",stdin);
    //freopen("C407.out","w",stdout);
    scanf("%d%d",&n,&m);
    for (int i = 1; i <= n; i++) scanf("%d",&b[i]);
    C[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        C[i][0] = 1;
        for (int j = 1; j <= 100; j++)
            C[i][j] = C[i-1][j] + C[i-1][j-1];
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d%d%d",&l,&r,&k);
        a[l][k] += 1;
        for (int j = 0; j <= k; j++)
            a[r+1][k - j] -= C[r+j-1][j];
    }

    for (int j = 100; j >= 0; j--)
            for (int i = 1; i <= n; i++)
                a[i][j] = a[i-1][j] + a[i][j+1] + a[i][j];

    for (int i = 1; i <= n; i++)
        printf("%d ",a[i][0] + b[i]);
    //1 1 1 1 -1
    //1 2 3 4
    //1 3 6 10
    fclose(stdin);
    fclose(stdout);
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <queue>
#include <iomanip>

using namespace std ;

#define FOREACH(it,c) for( __typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define REP(i,n) FOR(i,0,(n)-1)
#define DEP(i,n) DOW(i,(n)-1,0)
#define all(a) (a).begin() , (a).end()
#define mp(a,b) make_pair((a),(b))
#define RESET(c,x) memset (c, x, sizeof (c))
#define oo 1000111000
#define PI acos(-1.0)
#define fi first
#define se second
#define SIZE(c) (c).size()

typedef vector<int> VI ;
typedef vector<string> VS ;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;

template<class T> inline int size(const T&c) { return c.size(); }

using namespace std;
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

const int maxn = 100000+10;
const int cmod = 1000000007;
int b[maxn];
int C[maxn][110];
int a[maxn][110];
int n,m,l,r,k;
int main()
{
    //freopen("C407.inp","r",stdin);
    //freopen("C407.out","w",stdout);
    scanf("%d%d",&n,&m);
    for (int i = 1; i <= n; i++) scanf("%d",&b[i]);
    C[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        C[i][0] = 1;
        for (int j = 1; j <= 100; j++)
            C[i][j] = (C[i-1][j] + C[i-1][j-1])% cmod;
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d%d%d",&l,&r,&k);
        a[l][k] = (a[l][k] + 1) % cmod;
        for (int j = 0; j <= k; j++)
            a[r+1][k - j] = (a[r+1][k - j] - C[r+j-1][j]) % cmod;
    }

    for (int j = 100; j >= 0; j--)
            for (int i = 1; i <= n; i++)
                a[i][j] = ((a[i-1][j] + a[i][j+1]) % cmod + a[i][j]) % cmod;

    for (int i = 1; i <= n; i++)
        printf("%d ",((a[i][0] + b[i])  % cmod + cmod ) % cmod);
    //1 1 1 1 -1
    //1 2 3 4
    //1 3 6 10
    fclose(stdin);
    fclose(stdout);
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <queue>
#include <iomanip>

using namespace std ;

#define FOREACH(it,c) for( __typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define REP(i,n) FOR(i,0,(n)-1)
#define DEP(i,n) DOW(i,(n)-1,0)
#define all(a) (a).begin() , (a).end()
#define mp(a,b) make_pair((a),(b))
#define RESET(c,x) memset (c, x, sizeof (c))
#define oo 1000111000
#define PI acos(-1.0)
#define fi first
#define se second
#define SIZE(c) (c).size()

typedef vector<int> VI ;
typedef vector<string> VS ;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;

template<class T> inline int size(const T&c) { return c.size(); }

using namespace std;
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

const int maxn = 100000+10;
const int cmod = 1000000007;
int b[maxn];
int C[maxn][110];
int a[maxn][110];
int n,m,l,r,k;
int main()
{
    //freopen("C407.inp","r",stdin);
    //freopen("C407.out","w",stdout);
    scanf("%d%d",&n,&m);
    for (int i = 1; i <= n; i++) scanf("%d",&b[i]);
    C[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        C[i][0] = 1;
        for (int j = 1; j <= 102; j++)
            C[i][j] = (C[i-1][j] + C[i-1][j-1])% cmod;
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d%d%d",&l,&r,&k);
        a[l][k] = (a[l][k] + 1) % cmod;
        for (int j = 0; j <= k; j++)
            a[r+1][k - j] = (a[r+1][k - j] - C[r - l + j][j]) % cmod;
    }

    for (int j = 102; j >= 0; j--){
            for (int i = 1; i <= n; i++)
                {
                a[i][j] = ((a[i-1][j] + a[i][j+1]) % cmod + a[i][j]) % cmod;
                    //cout<<a[i][j];
                }
                //cout<<endl;
    }
    for (int i = 1; i <= n; i++)
        printf("%d ",((a[i][0] + b[i])  % cmod + cmod ) % cmod);
    //1 1 1 1 -1
    //1 2 3 4
    //1 3 6 10
    fclose(stdin);
    fclose(stdout);
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <queue>
#include <iomanip>

using namespace std ;

#define FOREACH(it,c) for( __typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define REP(i,n) FOR(i,0,(n)-1)
#define DEP(i,n) DOW(i,(n)-1,0)
#define all(a) (a).begin() , (a).end()
#define mp(a,b) make_pair((a),(b))
#define RESET(c,x) memset (c, x, sizeof (c))
#define oo 1000111000
#define PI acos(-1.0)
#define fi first
#define se second
#define SIZE(c) (c).size()

typedef vector<int> VI ;
typedef vector<string> VS ;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;

template<class T> inline int size(const T&c) { return c.size(); }

using namespace std;
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

const int maxn = 100000+10;
const int cmod = 1000000007;
long long b[maxn];
long long C[maxn][110];
long long a[maxn][110];
int n,m,l,r,k;
int main()
{
    //freopen("C407.inp","r",stdin);
    //freopen("C407.out","w",stdout);
    scanf("%d%d",&n,&m);
    for (int i = 1; i <= n; i++) scanf("%d",&b[i]);
    C[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        C[i][0] = 1;
        for (int j = 1; j <= 100; j++)
            C[i][j] = (C[i-1][j] + C[i-1][j-1])% cmod;
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d%d%d",&l,&r,&k);
        a[l][k] = (a[l][k] + 1) % cmod;
        for (int j = 0; j <= k; j++)
            a[r+1][k - j] = (a[r+1][k - j] - C[r - l + j][j]) % cmod;
    }

    for (int j = 100; j >= 0; j--){
            for (int i = 1; i <= n; i++)
                {
                a[i][j] = ((a[i-1][j] + a[i][j+1]) % cmod + a[i][j]) % cmod;
                    //cout<<a[i][j];
                }
                //cout<<endl;
    }
    for (int i = 1; i <= n; i++)
        printf("%d ",((a[i][0] + b[i])  % cmod + cmod ) % cmod);
    //1 1 1 1 -1
    //1 2 3 4
    //1 3 6 10
    fclose(stdin);
    fclose(stdout);
    return 0;
}