Greg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 ≤ li ≤ ri ≤ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by value di.

Greg wrote down k queries on a piece of paper. Each query has the following form: xi, yi, (1 ≤ xi ≤ yi ≤ m). That means that one should apply operations with numbers xi, xi + 1, ..., yi to the array.

Now Greg is wondering, what the array a will be after all the queries are executed. Help Greg.

Input

The first line contains integers n, m, k (1 ≤ n, m, k ≤ 105). The second line contains n integers: a1, a2, ..., an (0 ≤ ai ≤ 105) — the initial array.

Next m lines contain operations, the operation number i is written as three integers: li, ri, di, (1 ≤ li ≤ ri ≤ n), (0 ≤ di ≤ 105).

Next k lines contain the queries, the query number i is written as two integers: xi, yi, (1 ≤ xi ≤ yi ≤ m).

The numbers in the lines are separated by single spaces.

Output

On a single line print n integers a1, a2, ..., an — the array after executing all the queries. Separate the printed numbers by spaces.

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams of the %I64d specifier.

Examples

Input

3 3 3
1 2 3
1 2 1
1 3 2
2 3 4
1 2
1 3
2 3


Output

9 18 17


Input

1 1 1
1
1 1 1
1 1


Output

2


Input

4 3 6
1 2 3 4
1 2 1
2 3 2
3 4 4
1 2
1 3
2 3
1 2
1 3
2 3


Output

5 18 31 20
#include <bits/stdc++.h>
using namespace std;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
};
template <class A, class B>
ostream &operator<<(ostream &os, pair<A, B> p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, rge<T> d) {
  os << "[";
  for (auto it = d.b; it != d.e; it++) {
    os << (it == d.b ? "" : ", ") << *it;
  }
  return os << "]";
}
template <class T>
void mprint(vector<vector<T>> M) {
  cout << '\n';
  for (auto r : M) {
    cout << (range((r).begin(), (r).end())) << '\n';
  }
  cout << '\n';
}
const long long mod = 1e9 + 7;
const long long N = 1e5 + 5;
const long long inf = 1e9 + 5;
struct query {
  long long l, r, x;
};
vector<query> Q(N);
vector<long long> A(N);
struct segtree {
  int n;
  vector<long long> t;
  vector<long long> lazy;
  void pull(int u) { t[u] = t[(u << 1)] + t[(u << 1 | 1)]; }
  void push(int u, int l, int r) {
    if (lazy[u] == 0) return;
    t[u] += (r - l + 1) * lazy[u];
    if (l != r) {
      lazy[(u << 1)] += lazy[u];
      lazy[(u << 1 | 1)] += lazy[u];
    }
    lazy[u] = 0;
  }
  void build(int u, int l, int r) {
    if (l == r) {
      t[u] = A[l];
      return;
    }
    int m = (l + r) / 2;
    build((u << 1), l, m);
    build((u << 1 | 1), m + 1, r);
    pull(u);
  }
  void update(int u, int l, int r, int ll, int rr, long long x) {
    push(u, l, r);
    if (rr < l || ll > r || r < l) return;
    if (rr >= r && ll <= l) {
      lazy[u] += x;
      push(u, l, r);
      return;
    }
    int m = (l + r) / 2;
    update((u << 1), l, m, ll, rr, x);
    update((u << 1 | 1), m + 1, r, ll, rr, x);
    pull(u);
  }
  long long get(int u, int l, int r, int i) {
    push(u, l, r);
    if (l == r) return t[u];
    int m = (l + r) / 2;
    return i <= m ? get((u << 1), l, m, i) : get((u << 1 | 1), m + 1, r, i);
  }
  segtree(int n) {
    this->n = n;
    t.resize(4 * n, 0);
    lazy.resize(4 * n, 0);
    build(1, 1, n);
  }
};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr),
      cout.precision(15);
  long long n, m, k;
  cin >> n >> m >> k;
  for (int i = (1); i <= ((n)); i += (+1)) cin >> A[i];
  segtree st(n);
  for (int i = (1); i <= ((m)); i += (+1)) {
    long long l, r, x;
    cin >> l >> r >> x;
    Q[i] = {l, r, x};
  }
  A.assign(N, 0);
  segtree st_queries(m);
  for (int i = (1); i <= ((k)); i += (+1)) {
    long long l, r;
    cin >> l >> r;
    st_queries.update(1, 1, m, l, r, +1);
  }
  for (int i = (1); i <= ((m)); i += (+1)) {
    long long times = st_queries.get(1, 1, m, i);
    st.update(1, 1, n, Q[i].l, Q[i].r, Q[i].x * times);
  }
  for (int i = (1); i <= ((n)); i += (+1)) {
    cout << st.get(1, 1, n, i) << " \n"[i == n];
  }
  return 0;
}
