#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
#define P pair<ll,ll>
#define T tuple<int, int, int>
#define PP pair<P,P>
#define ALL(a) a.begin(), a.end()



int main(){
    int n, m, q;
    cin >> n >> m >> q;
    vi w(n), v(n);
    rep(i,n) cin >> w[i] >> v[i];
    vi x(m);
    rep(i,m) cin >> x[i];

    rep(i,q){
        int l, r;
        cin >> l >> r;
        l--; r--;
        auto X = x;
        REP(j,l,r+1){
            X[j] = 1e9;
        }
        sort(ALL(X));
        vector<bool> used(n, false);
        int ans = 0;
        rep(j,m){
            if (X[j] == 1e9) continue;
            int index = -1;
            int MAX = 0;
            rep(k,n){
                if (used[k]) continue;
                if (w[k] <= X[j] && v[k] > MAX){
                    index = k;
                    MAX = v[k];
                }
            }
            if (index == -1) continue;
            used[index] = true;
            ans += MAX;
        }
        cout << ans << endl;
    }
}
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

ll mod=1e9+7;
mat I;

mat mul(mat a,mat b)
{
	int n=a.size();
	mat c(n,vll(n));
	rep(i,0,n-1)rep(j,0,n-1)rep(k,0,n-1)
	{
		c[i][j]=(c[i][j]+a[i][k]*b[k][j])%mod;
	}
	return c;
}

ll p(ll a,ll b)
{
	ll r=1;
	while(b)
	{
		if(b%2)r=(r*a)%mod;
		a=(a*a)%mod;
		b/=2;
	}
	return r;
}

mat p(mat a,ll b)
{
	mat r=I;
	while(b)
	{
		if(b%2)
		r=mul(r,a);
		a=mul(a,a);
		b/=2;
	}
	return r;
}
ll n,m,k,e[105][105],a[105];

int main()
{ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m>>k;

I.resize(n);
rep(i,0,n-1)
{
	I[i].resize(n);
	I[i][i]=1;
}

rep(i,0,n-1)cin>>a[i];

rep(i,0,m-1)
{
	int x,y;
	cin>>x>>y;
	x--;y--;
	e[x][y]=1;
	e[y][x]=1;
}
mat prod(n,vll(n));

rep(i,0,n-1)
{
	ll ed=0;
	rep(j,0,n-1)ed+=e[i][j];
	prod[i][i]=(2*m-ed)%mod;
	rep(j,0,n-1)if(e[i][j])prod[i][j]=1;
}
prod=p(prod,k);

ll den=p(2*m,k);
den=p(den,mod-2);

rep(i,0,n-1)
{
	ll ans=0;
	rep(j,0,n-1)
	{
		ans=(ans+prod[i][j]*a[j])%mod;
	}
	ans=(ans*den)%mod;
	ol(ans);on;
}
return 0;
}



