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;
const long long int inf = 1e15;
const long long int mod = 1000000007;
int n, m, k;
long long int a[100010];
long long int st[400010];
long long int lazy[400010];
pair<pair<long long int, long long int>, long long int> q[100010];
int stQ[400010];
int lazyQ[400010];
void constructST(int l = 0, int r = n - 1, int i = 0) {
  if (l == r) {
    st[i] = a[l];
    return;
  }
  int mid = (l + r) / 2;
  constructST(l, mid, i * 2 + 1);
  constructST(mid + 1, r, i * 2 + 2);
  st[i] = st[i * 2 + 1] + st[i * 2 + 2];
}
void updateQ(int s, int e, int l = 0, int r = m - 1, int i = 0) {
  if (lazyQ[i] != 0) {
    stQ[i] += lazyQ[i] * (r - l + 1);
    if (l != r) {
      lazyQ[i * 2 + 1] += lazyQ[i];
      lazyQ[i * 2 + 2] += lazyQ[i];
    }
    lazyQ[i] = 0;
  }
  if (s > r or l > e) return;
  if (s <= l and r <= e) {
    stQ[i]++;
    if (l != r) {
      lazyQ[i * 2 + 1]++;
      lazyQ[i * 2 + 2]++;
    }
    return;
  }
  int mid = (l + r) / 2;
  updateQ(s, e, l, mid, i * 2 + 1);
  updateQ(s, e, mid + 1, r, i * 2 + 2);
  stQ[i] = stQ[i * 2 + 1] + stQ[i * 2 + 2];
}
int queryQ(int pos, int l = 0, int r = m - 1, int i = 0) {
  if (lazyQ[i] != 0) {
    stQ[i] += lazyQ[i] * (r - l + 1);
    if (l != r) {
      lazyQ[i * 2 + 1] += lazyQ[i];
      lazyQ[i * 2 + 2] += lazyQ[i];
    }
    lazyQ[i] = 0;
  }
  if (pos < l or r < pos) return 0;
  if (l == r) return stQ[i];
  int mid = (l + r) / 2;
  int left = queryQ(pos, l, mid, i * 2 + 1);
  int right = queryQ(pos, mid + 1, r, i * 2 + 2);
  return left + right;
}
void update(int s, int e, long long int val, int l = 0, int r = n - 1,
            int i = 0) {
  if (lazy[i] != 0) {
    st[i] += lazy[i] * (long long int)(r - l + 1);
    if (l != r) {
      lazy[i * 2 + 1] += lazy[i];
      lazy[i * 2 + 2] += lazy[i];
    }
    lazy[i] = 0;
  }
  if (s > r or l > e) return;
  if (s <= l and r <= e) {
    st[i] += val * (long long int)(r - l + 1);
    if (l != r) {
      lazy[i * 2 + 1] += val;
      lazy[i * 2 + 2] += val;
    }
    return;
  }
  int mid = (l + r) / 2;
  update(s, e, val, l, mid, i * 2 + 1);
  update(s, e, val, mid + 1, r, i * 2 + 2);
  st[i] = st[i * 2 + 1] + st[i * 2 + 2];
}
long long int query(int pos, int l = 0, int r = n - 1, int i = 0) {
  if (lazy[i] != 0) {
    st[i] += lazy[i] * (long long int)(r - l + 1);
    if (l != r) {
      lazy[i * 2 + 1] += lazy[i];
      lazy[i * 2 + 2] += lazy[i];
    }
    lazy[i] = 0;
  }
  if (pos < l or r < pos) return 0;
  if (l == r) return st[i];
  int mid = (l + r) / 2;
  long long int left = query(pos, l, mid, i * 2 + 1);
  long long int right = query(pos, mid + 1, r, i * 2 + 2);
  return left + right;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  constructST();
  for (int i = 0; i < m; i++) {
    cin >> q[i].first.first;
    cin >> q[i].first.second;
    cin >> q[i].second;
    q[i].first.first--;
    q[i].first.second--;
  }
  for (int i = 0; i < k; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    updateQ(l, r);
  }
  for (int i = 0; i < m; i++) {
    long long int num = q[i].second * (long long int)queryQ(i);
    int s = q[i].first.first;
    int e = q[i].first.second;
    update(s, e, num);
  }
  for (int i = 0; i < n; i++) cout << query(i) << " ";
  return 0;
}
