#include <bits/stdc++.h>

#define rep(i, n) for (auto i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()

using namespace std;

using ll = long long int;

const int MOD_NUM = 1e9 + 7;

struct Item {
    int size;
    int value;
};

bool compare_item_greater(const Item& l, const Item& r) {
    return l.value == r.value ? l.size < r.size : l.value > r.value;
}

int main() {
    // Input
    int N, M, Q;
    cin >> N >> M >> Q;
    vector<int> W(N), V(N), X(M);
    rep(i, N) cin >> W[i] >> V[i];
    rep(i, M) cin >> X[i];

    vector<Item> items(N);
    rep(i, N) items[i] = {W[i], V[i]};
    sort(ALL(items), compare_item_greater);

    for (; Q > 0; Q--) {
        // Input
        int L, R;
        cin >> L >> R;

        // Process
        vector<int> x(L - 1 + M - R);
        copy(X.begin(), X.begin() + L - 1, x.begin());
        copy(X.begin() + R, X.end(), x.begin() + L - 1);
        sort(ALL(x));

        int ans = 0;
        for (Item item : items) {
            auto iter = lower_bound(ALL(x), item.size);
            if (iter != x.end()) {
                ans += item.value;
                x.erase(iter);
            }
        }

        // Output
        cout << ans << endl;
    }

    return 0;
}

#include <bits/stdc++.h>
#include <map>
#include <iostream>

using namespace std;
typedef long long ll;
typedef long double ld;
#define BIG 200005
int N;
struct Data{
    int ind;
    int label; // ans
    bool tree = false; // in tree?
    vector<pair<int, int>> edges; // node, label
    vector<pair<int, int>> tree_edges;

};
vector<Data> nodes(BIG);

bool make_tree(int p, int c){
    if(nodes[c].tree) return false;
    nodes[c].tree = true;
    for(auto child: nodes[c].edges){
        if(child.first == p) continue;
        bool created = make_tree(c, child.first);
        if(created){
            nodes[c].tree_edges.push_back(make_pair(child.first, child.second));
        }
    }
    return true;
}

void solve(int p, int c, int l){
    // decide my label
    if(p!=l){
        nodes[c].label = l;
    }else{
        // l以外の適当な値
        nodes[c].label = l % N + 1; 
    }
    for(auto child: nodes[c].tree_edges){
        solve(nodes[c].label, child.first, child.second);
    }
}

int main() {
    int M;
    cin >> N >> M;
    for(int i=0;i<M;i++){
        int u, v, c;
        cin >> u >> v >> c;
        u--;
        v--;
        nodes[u].edges.push_back(make_pair(v, c));
        nodes[v].edges.push_back(make_pair(u, c));
    }
    // make a tree
    make_tree(-1, 0);
    solve(1, 0, 1);
    for(int i=0;i<N;i++){
        Data d = nodes[i];
        printf("%d\n", d.label);
    }
    return 0;
}