#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define P 998244353
#define rep(i,n) for(i=0;i<n;++i)
#define re(i,a,n) for(i=a;i<=n;++i)
#define repr(i,a,n) for(i=a;i>=n;--i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second


ll binpow(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
   while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll modInverse(ll n, ll p)
{
    return binpow(n, p-2, p);
}

/*const ll MAXN=4e6+1;
ll spf[MAXN];
void sieve() 
{ 
    spf[1] = 1; 
    ll i,j;
    for (i=2; i<MAXN; i++) 
          spf[i] = i; 
  
    for (i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (i=3; i*i<MAXN; i++) 
    { 
        
        if (spf[i] == i) 
        { 
            
            for (j=i*i; j<MAXN; j+=i) 
  
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} */



int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll m,n,i,f=0,j,ans=0,k,x,r,l,t,y,h,w;
    cin >> h >> w >> n >> m ;
    set<ll> s;
    ll a[h][w];

    ll used[h][w];
    rep(i,h)
    {
      rep(j,w){ a[i][j]=0; used[i][j]=0;}
    }
    vector<vector<ll>> row(h),col(w),rowb(h),colb(w);
    rep(i,n)
    {
        cin >> x >> y ;
        x--;
        y--;
        a[x][y]=1;
    }
    rep(i,m)
    {
      cin >> x>> y ;
      x--;
      y--;
      a[x][y]=-1;
    }


    
    rep(i,h)
    {
      f=0;
      rep(j,w)
      {
          if(a[i][j]==1)
          {
              f=1;
          }
          else if(a[i][j]==-1) f=-1;
          if(f==1) used[i][j]=1; 
      }

    }
    rep(i,h)
    {
      f=0;
      rep(j,w)
      {
          if(a[i][w-j-1]==1)
          {
              f=1;
          }
          else if(a[i][w-j-1]==-1) f=-1;
          if(f==1) used[i][w-j-1]=1; 
      }

    }
    rep(j,w)
    {
      f=0;
      rep(i,h)
      {
          if(a[h-i-1][j]==1)
          {
              f=1;
          }
          else if(a[h-i-1][j]==-1) f=-1;
          if(f==1) used[h-i-1][j]=1; 
      }

    }
rep(j,w)
    {
      f=0;
      rep(i,h)
      {
          if(a[i][j]==1)
          {
              f=1;
          }
          else if(a[i][j]==-1) f=-1;
          if(f==1) used[i][j]=1; 
      }

    }
    rep(i,h)
    {
      rep(j,w) 
      {
        if(used[i][j]==1)
        {
          //cout << i << " " << j << endl ;
          ans++;
        } 
      }
    }
    cout << ans ;




    return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define IN(x,c) (find(c.begin(),c.end(),x) != (c).end())
#define REP(i,n) for (int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define INIT(a,v) memset(a,v,sizeof(a))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
template<class A, class B> A cvt(B x) { stringstream ss; ss<<x; A y; ss>>y; return y; }

#define SPC << " " <<
#define DEBUG(x) cerr << #x << " = "; cerr << x << endl;
#define DEBUG_ITER(x) cerr << #x << " = "; for (auto _ : x) cerr << _ << ' '; cerr << endl;

typedef pair<int,int> PII;
typedef long long int64;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<double> VD;

#define MOD 1000000007

/* Matrix operations */

typedef int64 Element;
typedef vector<Element> Row;
typedef vector<Row> Matrix;

Matrix zeros(int h, int w) {
    return Matrix(h, Row(w));
}

Matrix identity(int n) {
    Matrix c = zeros(n,n);
    REP (i,n) c[i][i]=1;
    return c;
}

Matrix transpose(const Matrix &a) {
    int h=a[0].size(), w=a.size();
    Matrix t = zeros(h, w);
    REP (i,h) REP (j,w) t[i][j]=a[j][i];
    return t;
}

Matrix operator+(const Matrix &a, const Matrix &b) {
    int h=a.size(), w=a[0].size();
    assert(a.size()==b.size() && a[0].size()==b[0].size());
    Matrix c = zeros(h,w);
    REP (i,h) REP (j,w) {
        c[i][j]=a[i][j]+b[i][j];
        c[i][j]%=MOD;
    }
    return c;
}

Matrix operator+(const Matrix &a, Element k) {
    int h=a.size(), w=a[0].size();
    Matrix c = a;
    REP (i,h) REP (j,w) {
        c[i][j]+=k;
        c[i][j]%=MOD;
    }
    return c;
}

Matrix operator*(Element k, const Matrix &a) {
    int h=a.size(), w=a[0].size();
    Matrix c = a;
    REP (i,h) REP (j,w) {
        c[i][j]*=k;
        c[i][j]%=MOD;
    }
    return c;
}

Matrix operator*(const Matrix &a, const Matrix &b) {
    int h=a.size(), w=b[0].size();
    assert(a[0].size()==b.size());
    Matrix c = zeros(h,w);
    REP (i,h) REP (j,w) {
        REP (k,a[0].size()) {
            c[i][j]+=a[i][k]*b[k][j];
            c[i][j]%=MOD;
        }
    }
    return c;
}

Matrix operator+(Element k, const Matrix &a) {
    return a+k;
}

Matrix operator*(const Matrix &a, Element k) {
    return k*a;
}

Matrix operator-(const Matrix &a, const Matrix &b) {
    return a+(-1)*b;
}

Matrix mat_pow(const Matrix &a, int k) {
    assert(a.size()==a[0].size());
    if (k==0) return identity(a.size());
    if (k%2==0) {
        Matrix c=mat_pow(a,k/2);
        return c*c;
    } else {
        Matrix c=mat_pow(a,k-1);
        return c*a;
    }
}

void mat_print(const Matrix &a) {
    REP (i,a.size()) {
        REP (j,a[i].size()) {
            if (j!=0) cout << " ";
            cout << a[i][j];
        }
        cout << endl;
    }
}

int modPow(int a, int k, int m) {
	if (k==0) return 1;
	else if (k%2==0) {
		int64 b=modPow(a,k/2,m);
		return (b*b)%m;
	} else {
		int64 b=modPow(a,k-1,m);
		return (a*b)%m;
	}
}

int n,m,k;
int a[100];
int deg[100];
vector<int> adj[100];

int main() {
    //freopen("test.in","r",stdin);
    cin >> n >> m >> k;
    REP (i,n) cin >> a[i];
    Matrix A = zeros(n,n);
    REP (i,m) {
        int x,y;
        cin >> x >> y;
        x--; y--;
        adj[x].PB(y); adj[y].PB(x);
        deg[x]++; deg[y]++;
    }
    int64 inv_2m=modPow(2*m,MOD-2,MOD);
    int64 inv_m=modPow(m,MOD-2,MOD);
    REP (i,n) {
        for (int j : adj[i]) {
            A[i][j]=inv_2m; //1.0/(2*m);
            A[i][i]=(A[i][i]+inv_2m)%MOD; //+=1.0/(2*m);
        }
        A[i][i]=(A[i][i]+(m-deg[i])*inv_m)%MOD;
    }
    Matrix v = zeros(n,1);
    REP (i,n) v[i][0]=a[i];
    Matrix Ak = mat_pow(A,k);
    Matrix vk = Ak*v;
    REP (i,n) {
        cout << vk[i][0] << endl;
    }
    return 0;
}
