In this problem you will have to deal with a very special network.

The network consists of two parts: part A and part B. Each part consists of n vertices; i-th vertex of part A is denoted as Ai, and i-th vertex of part B is denoted as Bi.

For each index i (1 ≤ i < n) there is a directed edge from vertex Ai to vertex Ai + 1, and from Bi to Bi + 1, respectively. Capacities of these edges are given in the input. Also there might be several directed edges going from part A to part B (but never from B to A).

You have to calculate the [maximum flow value](https://en.wikipedia.org/wiki/Maximum_flow_problem) from A1 to Bn in this network. Capacities of edges connecting Ai to Ai + 1 might sometimes change, and you also have to maintain the maximum flow value after these changes. Apart from that, the network is fixed (there are no changes in part B, no changes of edges going from A to B, and no edge insertions or deletions).

Take a look at the example and the notes to understand the structure of the network better.

Input

The first line contains three integer numbers n, m and q (2 ≤ n, m ≤ 2·105, 0 ≤ q ≤ 2·105) — the number of vertices in each part, the number of edges going from A to B and the number of changes, respectively.

Then n - 1 lines follow, i-th line contains two integers xi and yi denoting that the edge from Ai to Ai + 1 has capacity xi and the edge from Bi to Bi + 1 has capacity yi (1 ≤ xi, yi ≤ 109).

Then m lines follow, describing the edges from A to B. Each line contains three integers x, y and z denoting an edge from Ax to By with capacity z (1 ≤ x, y ≤ n, 1 ≤ z ≤ 109). There might be multiple edges from Ax to By.

And then q lines follow, describing a sequence of changes to the network. i-th line contains two integers vi and wi, denoting that the capacity of the edge from Avi to Avi + 1 is set to wi (1 ≤ vi < n, 1 ≤ wi ≤ 109).

Output

Firstly, print the maximum flow value in the original network. Then print q integers, i-th of them must be equal to the maximum flow value after i-th change.

Example

Input

4 3 2
1 2
3 4
5 6
2 2 7
1 4 8
4 3 9
1 100
2 100


Output

9
14
14

Note

This is the original network in the example:

<image>
#include <bits/stdc++.h>
using namespace std;
const int maxn = 200020;
int n, m, q;
long long A[maxn], B[maxn], C[maxn];
struct edge {
  int a, b;
  long long w;
  bool operator<(const edge &x) const { return a < x.a; }
} e[maxn];
long long tr[maxn << 2], lz[maxn << 2];
void push_up(int o) { tr[o] = min(tr[o << 1], tr[o << 1 | 1]); }
void push_down(int o) {
  if (lz[o]) {
    tr[o << 1] += lz[o];
    tr[o << 1 | 1] += lz[o];
    lz[o << 1] += lz[o];
    lz[o << 1 | 1] += lz[o];
    lz[o] = 0;
  }
}
void build(int o, int l, int r) {
  lz[o] = 0;
  if (l == r) {
    tr[o] = C[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  push_up(o);
}
void update(int o, int l, int r, int kl, int kr, long long x) {
  if (kl == l && kr == r) {
    tr[o] += x;
    lz[o] += x;
    return;
  }
  push_down(o);
  int mid = (l + r) >> 1;
  if (kr <= mid)
    update(o << 1, l, mid, kl, kr, x);
  else if (kl > mid)
    update(o << 1 | 1, mid + 1, r, kl, kr, x);
  else {
    update(o << 1, l, mid, kl, mid, x);
    update(o << 1 | 1, mid + 1, r, mid + 1, kr, x);
  }
  push_up(o);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 1; i < n; i++) cin >> A[i] >> B[i], C[i] = B[i];
  for (int i = 1; i <= m; i++) cin >> e[i].a >> e[i].b >> e[i].w;
  sort(e + 1, e + 1 + m);
  build(1, 0, n - 1);
  for (int i = 1, j = 1; i <= n; i++) {
    while (j <= m && e[j].a <= i)
      update(1, 0, n - 1, 0, e[j].b - 1, e[j].w), j++;
    C[i] = A[i] + tr[1];
  }
  build(1, 1, n);
  cout << tr[1] << "\n";
  while (q--) {
    int g, h;
    cin >> g >> h;
    update(1, 1, n, g, g, h - A[g]);
    A[g] = h;
    cout << tr[1] << "\n";
  }
}
