Problem: You've got an array consisting of n integers: a[1], a[2], ..., a[n]. Moreover, there are m queries, each query can be described by three integers li, ri, ki. Query li, ri, ki means that we should add <image> to each element a[j], where li ≤ j ≤ ri.

Record <image> means the binomial coefficient, or the number of combinations from y elements into groups of x elements.

You need to fulfil consecutively all queries and then print the final array.

Input

The first line contains integers n, m (1 ≤ n, m ≤ 105).

The second line contains n integers a[1], a[2], ..., a[n] (0 ≤ ai ≤ 109) — the initial array.

Next m lines contain queries in the format li, ri, ki — to all elements of the segment li... ri add number <image> (1 ≤ li ≤ ri ≤ n; 0 ≤ k ≤ 100).

Output

Print n integers: the i-th number is the value of element a[i] after all the queries. As the values can be rather large, print them modulo 1000000007 (109 + 7).

Examples

Input

5 1
0 0 0 0 0
1 5 0


Output

1 1 1 1 1


Input

10 2
1 2 3 4 5 0 0 0 0 0
1 6 1
6 10 2


Output

2 4 6 8 10 7 3 6 10 15

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;


/**
 * Created by Katushka on 14.02.2021.
 */
public class Main {

    static void sortArray(int[] a, boolean rev) {
        Random random = new Random();

        for (int i = 0; i < a.length; i++) {
            int randomPos = random.nextInt(a.length);
            int t = a[i];
            a[i] = a[randomPos];
            a[randomPos] = t;
        }
        Arrays.sort(a);
        if (rev) {
            for (int i = 0; i < a.length / 2; i++) {
                int t = a[i];
                a[i] = a[a.length - i - 1];
                a[a.length - i - 1] = t;
            }
        }
    }

    static int[] readArray(int size, InputReader in, boolean subOne) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextInt() + (subOne ? -1 : 0);
        }
        return a;
    }

    static long[] readLongArray(int size, InputReader in) {
        long[] a = new long[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextLong();
        }
        return a;
    }


    private static final long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        long[] a = readLongArray(n, in);
        long[] allInvs = allInvs(102, MOD);

        long[][] dp = new long[101][n + 1];
        for (int i = 0; i < m; i++) {
            int l = in.nextInt() - 1;
            int r = in.nextInt();
            int k = in.nextInt();

            dp[100 - k][l] = addMod(dp[100 - k][l], 1, MOD);
            long c = 1;
            for (int j = 100 - k; j <= 100; j++) {
                int t = j - (100 - k);
                dp[j][r] = subMod(dp[j][r], c, MOD);
                c = c * (r - l - 1 + t + 1) % MOD * allInvs[t + 1] % MOD;
            }
        }

        for (int i = 0; i < 101; i++) {
            for (int j = 0; j <= n; j++) {
                if (i > 0) {
                    dp[i][j] = addMod(dp[i][j], dp[i - 1][j], MOD);
                }
                if (j > 0) {
                    dp[i][j] = addMod(dp[i][j], dp[i][j - 1], MOD);
                }
            }
        }
        for (int i = 0; i < n; i++) {
            a[i] = addMod(a[i], dp[100][i], MOD);
        }

        outputArray(a, out, false);

        out.close();
    }

    private static long[] allInvs(int n, long mod) {
        long[] inv = new long[n + 1];
        inv[1] = 1;
        for (int i = 2; i <= n; ++i) {
            inv[i] = subMod(mod, (mod / i) * inv[(int) (mod % i)] % mod, mod);
        }
        return inv;

    }

    private static long addMod(long x, long y, long mod) {
        long res = x + y;
        if (res >= mod) {
            return res - mod;
        }
        return res;
    }

    private static long subMod(long x, long y, long mod) {
        long res = x - y;
        if (res < 0) {
            return res + mod;
        }
        return res;
    }

    private static void outputArray(long[] ans, PrintWriter out, boolean addOne) {
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < ans.length; i++) {
            long an = ans[i] + (addOne ? 1 : 0);
            str.append(an).append(' ');
        }
        out.println(str);
        out.flush();
    }

    private static void outputArray(List<Long> ans, PrintWriter out, boolean addOne) {
        StringBuilder str = new StringBuilder();
        for (long i : ans) {
            long an = i + (addOne ? 1 : 0);
            str.append(an).append(' ');
        }
        out.println(str);
        out.flush();
    }

    private static int[] getBinary(long a, int size) {
        int[] result = new int[size];
        for (int i = 0; i < size; i++) {
            result[i] = (int) ((a >> i) & 1);
        }
        return result;
    }

    private static int fromBinary(int[] binary) {
        int res = 0;
        int d = 1;
        for (int i = 0; i < binary.length; i++) {
            if (binary[i] == 1) {
                res = res | d;
            }
            d = d << 1;
        }
        return res;
    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextWord() {
            return next();
        }

        private List<Integer>[] readTree(int n) {
            List<Integer>[] result = new ArrayList[n];
            for (int i = 0; i < n; i++) {
                result[i] = new ArrayList<>();
            }
            for (int i = 0; i < n - 1; i++) {
                int u = nextInt() - 1;
                int v = nextInt() - 1;
                result[u].add(v);
                result[v].add(u);
            }
            return result;
        }

    }
}