#include <bits/stdc++.h>

long long func(std::vector<std::pair<long long, long long>> &vw, std::vector<long long> &boxsize, int l, int r) {
  std::vector<long long> box;
  for (int i = 0; i < (int)boxsize.size(); ++i) {
    if (i < l || i > r) box.push_back(boxsize[i]);
  }

  std::vector<bool> used(box.size(), false);
  std::sort(box.begin(), box.end());

  long long res = 0LL;
  for (int i = 0; i < (int)vw.size(); ++i) {
    long long value = vw[i].first;
    long long weight = vw[i].second;

    int index = std::lower_bound(box.begin(), box.end(), weight) - box.begin();
    while (index < (int)box.size() && used[index]) ++index;
    if (index < (int)box.size()) { used[index] = true; res += value; }
  }

  return res;
}

int main() {
  int n, m, q;
  std::cin >> n >> m >> q;
  std::vector<std::pair<long long, long long>> vw(n);
  for (int i = 0; i < n; ++i) std::cin >> vw[i].second >> vw[i].first;
  std::vector<long long> boxsize(m);
  for (int i = 0; i < m; ++i) std::cin >> boxsize[i];

  std::sort(vw.begin(), vw.end(), std::greater<std::pair<long long, long long>>());

  std::vector<long long> res;
  for (int i = 0; i < q; ++i) {
    int l, r;
    std::cin >> l >> r;
    --l; --r;
    res.push_back(func(vw, boxsize, l, r));    
  }

  for (long long ans : res) std::cout << ans << std::endl;
  return 0;  
}

#include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N, M; cin >> N >> M;
  using nbr_t = tuple<ll, ll, bool>;
  vector<vector<nbr_t>> nbr(N + 1);
  vector<bool> edir(M + 1);
  for (ll i = 1; i <= M; i++) {
    ll a, b; cin >> a >> b;
    nbr[a].emplace_back(b, i, true);
    nbr[b].emplace_back(a, i, false);
  }
  vector<ll> C(N + 1);
  for (ll i = 1; i <= N; i++) cin >> C[i];
  vector<bool> visited(N + 1);
  auto dfs = [&](auto rF, ll nd) -> void {
    if (visited[nd]) return;
    visited[nd] = 1;
    for (auto [m, ei, fl] : nbr[nd]) {
      if (C[nd] > C[m]) {
        edir[ei] = fl;
      }else if (C[nd] < C[m]) {
        edir[ei] = !fl;
      }else {
        edir[ei] = fl;
        rF(rF, m);
      }
    }
  };
  for (ll i = 1; i <= N; i++) {
    dfs(dfs, i);
  }

  for (ll i = 1; i <= M; i++) {
    if (edir[i]) {
      cout << "->\n";
    }else {
      cout << "<-\n";
    }
  }

  return 0;
}

