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

#ifdef LOCAL
#include "../debug.h"
#else
#define debug(x...) 141
#endif
#define forn(i,x,n) for(int i = x; i < n; ++i)
#define forit(it, m) for(auto it = m.begin(); it!=m.end(); ++it)
typedef long long ll;

ll n,m,k,x,y,p=1e9+7,invm;

void mult(vector<vector<ll>>& a, vector<vector<ll>>& b){
	vector<vector<ll>> c(n,vector<ll>(n));
	forn(i,0,n)
		forn(j,0,n)
			forn(k,0,n)
				c[i][j]+=a[i][k]*b[k][j], c[i][j]%=p;
	swap(a,c);
}

vector<vector<ll>> power(vector<vector<ll>>& F, int N){
	vector<vector<ll>> res(n,vector<ll>(n));
	forn(i,0,n)
		res[i][i]=1;
	while(N){
		if(N%2)
			mult(res,F);
		mult(F,F);
		N/=2;
	}
	return res;
}

int inv(ll m){
	ll res=1, n=p-2;
	while(n){
		if(n%2)
			res*=m, res%=p;
		m*=m, m%=p;
		n/=2;
	}
	return res;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    cin>>n>>m>>k;
    invm = inv(2ll*m);
    vector<vector<ll>> adj(n,vector<ll>(n)), a(n,vector<ll>(1));
    vector<int> deg(n);
    forn(i,0,n)
    	cin>>a[i][0];
    forn(_,0,m){
    	cin>>x>>y, x--, y--;
    	adj[x][y]=adj[y][x]=invm, deg[x]++, deg[y]++;
    }
    forn(i,0,n)
    	adj[i][i]=(p*p+1-deg[i]*invm)%p;
    adj = power(adj,k);
    mult(adj,a);
    forn(i,0,n)
    	cout<<adj[i][0]<<'\n';
    
    return 0;
}
#include<bits/stdc++.h>
using namespace std;

#define INF 1234567890
#define ll long long
#define MOD 1000000007

ll pw(ll a, ll n)
{
	ll ret = 1;
	while(n)
	{
		if (n&1) ret=ret*a%MOD;
		a=a*a%MOD;
		n>>=1;
	}
	return ret;
}

ll inv(ll a)
{
	return pw(a, MOD-2);
}

int N, M, K;
vector<vector<ll> > V, A, g;
ll deg[101];

ll tmp[101][101];
void mul(int n, int m, int p, vector<vector<ll> > &ret, vector<vector<ll> > &A, vector<vector<ll> > &B)
{
	for(int i=0; i<n; i++)
		for(int j=0; j<p; j++)
			tmp[i][j] = 0;
	for(int i=0; i<n; i++)
		for(int k=0; k<m; k++)
			for(int j=0; j<p; j++)
			{
				tmp[i][j] += A[i][k] * B[k][j];
				tmp[i][j] %= MOD;
			}
	for(int i=0; i<n; i++)
		for(int j=0; j<p; j++)
			ret[i][j] = tmp[i][j];
}

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	cin.exceptions(ios::badbit | ios::failbit);
	cin >> N >> M >> K;
	vector<vector<ll> > V(N, vector<ll>(1));
	vector<vector<ll> > A(N, vector<ll>(N));
	vector<vector<ll> > g(N, vector<ll>(N));

	for(int i=0; i<N; i++)
		cin >> V[i][0];
	for(int i=0; i<M; i++)
	{
		int a, b;
		cin >> a >> b;
		a--; b--;
		g[a][b] = g[b][a] = inv(2*M);
		deg[a]++; deg[b]++;
	}
	for(int i=0; i<N; i++)
		g[i][i] = (2*M-deg[i]) * inv(2*M) % MOD;
	
	for(int i=0; i<N; i++)
		A[i][i] = 1;
	while(K)
	{
		if (K & 1) mul(N, N, N, A, A, g);
		mul(N, N, N, g, g, g);
		K >>= 1;
	}
	mul(N, N, 1, V, A, V);
	for(int i=0; i<N; i++)
	{
		ll res = V[i][0];
		res %= MOD; res += MOD; res %= MOD;
		cout << res << "\n";
	}
	return 0;
}