#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) ((int)(x).size())
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

const int inf = 1 << 30;
const ll INF = 1LL << 60;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    int h, w, n, m;
    cin >> h >> w >> n >> m;
    VVI mp(h, VI(w));
    VP L(n);
    rep(i,n){
        int a, b;
        cin >> a >> b;
        a--; b--;
        L[i].first = a, L[i].second = b;
    }
    rep(i, m){
        int c, d;
        cin >> c >> d;
        c--; d--;
        mp[c][d] = -1;
    }
    vector<vector<vector<bool>>> visited(h, vector<vector<bool>>(w, vector<bool>(4)));
    auto check = [&](int x, int y){
        if (x < 0 || x >= w || y < 0 || y >= h) return false;
        else return true;
    };
    rep(li, n){
        int row = L[li].first, col = L[li].second;
        rep(i, 4){
            if (visited[row][col][i]) continue;
            visited[row][col][i] = true;

            int sy = row + dy[i], sx = col + dx[i];
            while(check(sx, sy)){
                if (mp[sy][sx] == -1 || visited[sy][sx][i]) break;
                visited[sy][sx][i] = true;
                sy += dy[i], sx += dx[i];
            }
        }
    }
    int ans = 0;
    rep(row, h) rep(col, w){
        bool ok = false;
        rep(i, 4) if (visited[row][col][i]) ok = true;
        if (ok) ans++;
    }
    view(ans);
    return 0;
}
//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#define int long long
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define a first
#define b second
#define fi first
#define sc second
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
#define si(x) int(x.size())

#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}

template<class t> using vc=vector<t>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.fi<<","<<p.sc<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 1000000007;//998244353
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
template<class T> using mat = vc<vc<T>>;
mat<ll> make_e(int n){
	mat<ll>ret(n, vc<ll>(n));
	rep(i, n) ret[i][i] = 1;
	return ret;
}
template<class T>
mat<T> operator+(mat<T> a, mat<T> b){
	assert(a.size() == b.size());
	if(a.size()) assert(a[0].size() == b[0].size());
	
	rep(i, a.size()) rep(j, a[0].size()){
		a[i][j] += b[i][j];
		if(a[i][j] >= mod) a[i][j] -= mod;
	}
	
	return a;
}
template<class T>
mat<T> operator-(mat<T> a, mat<T> b){
	assert(a.size() == b.size());
	if(a.size()) assert(a[0].size() == b[0].size());
	
	rep(i, a.size()) rep(j, a[0].size()){
		a[i][j] += mod - b[i][j];
		if(a[i][j] >= mod) a[i][j] -= mod;
	}
	
	return a;
}
template<class T>
mat<T> operator*(mat<T> a, mat<T> b){
	if(a.empty() || b.empty()) return mat<T>();
	int n = a.size();
	int m = b[0].size();
	int len = a[0].size();
	assert(len == b.size());
	mat<T>ret(n);
	rep(i, n) ret[i] = vc<T>(m);
	
	rep(i, n) rep(j, len) rep(k, m){
		ll add = (ll)(a[i][j]) * b[j][k];
		add %= mod;
		ret[i][k] += add;
		if(ret[i][k] >= mod) ret[i][k] -= mod;
	}
	return ret;
}

void solve(){
	int n, m, k;
	cin >> n >> m >> k;
	
	mat<ll>M = make_e(n);
	vc<ll>num(n);
	rep(i, n) cin>>num[i];
	ll rv = modpow(2*m, mod-2);
	rep(i, m){
		int a, b; cin >> a >> b;
		a--; b--;
		M[a][a] -= rv;
		M[b][b] -= rv;
		M[a][b] += rv;
		M[b][a] += rv;
	}
	rep(i, n) rep(j, n) M[i][j] = (M[i][j]%mod+mod)%mod;
	
	mat<ll>ret(n, vc<ll>(n));
	rep(i, n) ret[i][i] = 1;
	while(k){
		if(k&1) ret = ret*M;
		k >>= 1;
		M = M*M;
	}
	mat<ll>ans(n, vc<ll>(1));
	rep(i, n) ans[i][0] = num[i];
	auto result = ret*ans;
	rep(i, n) o(result[i][0]);
}
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	int t; t = 1; //cin >> t;
	while(t--) solve();
}
