Greg has an array *a* = *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> and *m* operations. Each operation looks as: *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *d*<sub class="lower-index">*i*</sub>, (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ *n*). To apply operation *i* to the array means to increase all array elements with numbers *l*<sub class="lower-index">*i*</sub>, *l*<sub class="lower-index">*i*</sub> + 1, ..., *r*<sub class="lower-index">*i*</sub> by value *d*<sub class="lower-index">*i*</sub>.

Greg wrote down *k* queries on a piece of paper. Each query has the following form: *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>, (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *y*<sub class="lower-index">*i*</sub> ≤ *m*). That means that one should apply operations with numbers *x*<sub class="lower-index">*i*</sub>, *x*<sub class="lower-index">*i*</sub> + 1, ..., *y*<sub class="lower-index">*i*</sub> to the array.

Now Greg is wondering, what the array *a* will be after all the queries are executed. Help Greg.
The first line contains integers *n*, *m*, *k* (1 ≤ *n*, *m*, *k* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* integers: *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>) — the initial array.

Next *m* lines contain operations, the operation number *i* is written as three integers: *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *d*<sub class="lower-index">*i*</sub>, (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ *n*), (0 ≤ *d*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>).

Next *k* lines contain the queries, the query number *i* is written as two integers: *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>, (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *y*<sub class="lower-index">*i*</sub> ≤ *m*).

The numbers in the lines are separated by single spaces.
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <tuple>
#include <set>
#include <cstdio>
#include <iomanip>
#include <cmath>
#define ll long long
using namespace std;
void sollution() {
    ll n, m, k;
    cin >> n >> m >> k;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<vector<ll>> b(m, vector<ll>(3));
    for (int i = 0; i < m; i++) {
        cin >> b[i][0] >> b[i][1] >> b[i][2];
    }
    vector<ll> c(m);
    for (int i = 0; i < k; i++) {
        ll c1, c2;
        cin >> c1 >> c2;
        for (int i = c1; i <= c2; i++) {
            c[i - 1] += 1;
        }
    }
    for (int i = 0; i < m; i++) {
        c[i] *= b[i][2];
    }
    vector<ll> d(n + 1);
    for (int i = 0; i < m; i++) {
        d[b[i][0] - 1] += c[i];
        d[b[i][1]] -= c[i];
    }
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += d[i];
        cout << a[i] + tmp << " ";
    }
}
int main() {
    std::cout << std::fixed << std::setprecision(2);
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    sollution();
    std::cout << std::endl;
    return 0;
}
