#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long, long long>
using namespace std;

const int mod = 1e9+7;
#define INF INT_MAX

int sum(int x, int y)
{
	return (x+y)%mod;
}

int mult(int x, int y)
{
	return (1ll * x * y)% mod;
}

int fastpow(int val, int pow)
{	
	int res = 1;
	while(pow > 0)
	{
		if(pow % 2 != 0)
			res = mult(res, val);
		val = mult(val, val);
		pow/=2;
	}
	return res;
}

vector<vector<int>> matmult(vector<vector<int>> &mat1, vector<vector<int>> &mat2)
{
	vector<vector<int>> res(mat1.size(),vector<int>(mat1[0].size(),0));
	int m = mat1.size(), n = mat1[0].size();
	for(int i=0;i<m;i++)
	{
		for(int j = 0; j < n; j++)
		{
			for(int k=0;k<n;k++)
			{
				res[i][j] = sum(res[i][j], mult(mat1[i][k], mat2[k][j]));
			}
		}
	}

	return res;
}

vector<vector<int>> matexp(vector<vector<int>> mat, int pow)
{
	vector<vector<int>>res(mat.size(), vector<int>(mat[0].size(),0));
	
	for(int i=0;i<mat.size();i++)
		res[i][i] = 1;
	
	while(pow > 0)
	{
		if(pow%2!=0)
			res  = matmult(res, mat);
		pow/=2;
		if(pow == 0)
			break;
		mat = matmult(mat, mat);

	}

	return res;
}

vector<int> deg(105);

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,m,k;
	cin>>n>>m>>k;
	vector<int> a(n);
	
	int inv_2 = fastpow(2,mod-2);
	int inv_m = fastpow(m,mod-2);
	vector<vector<int>> mat(n, vector<int>(n,0));
	for(int i=0;i<n;i++)
		cin>>a[i];
	
	for(int i=0;i<m;i++)
	{
		int x,y;
		cin>>x>>y;
		x--;
		y--;
		deg[x]++;
		deg[y]++;
		mat[x][y] = mult(inv_2, inv_m);
		mat[y][x] = mult(inv_2, inv_m);

		
	}


	
	for(int i=0;i<n;i++)
	{
		mat[i][i] = mult(sum(mult(2,m), -deg[i]),mult(inv_2,inv_m)); 	
	}
	mat = matexp(mat,k);
	vector<int> res(n);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
			res[i] = sum(res[i], mult(a[j],mat[j][i]));
	}
	for(int i=0;i<n;i++)
		cout<<res[i]<<"\n";


}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define pb emplace_back
#define lb(v,k) (lower_bound(all(v),(k))-v.begin())
#define ub(v,k) (upper_bound(all(v),(k))-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
#define all(a) a.begin(),a.end()
#define rsort(a) {sort(all(a));reverse(all(a));}
#define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());}
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vvvvi=vector<vvvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001001;
const ll INF=1001001001;
const ll mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void outset(T s){auto itr=s.begin();while(itr!=s.end()){if(itr!=s.begin())cout<<' ';cout<<*itr;itr++;}cout<<'\n';}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){ll res=1;a%=mod;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;}
vi matmul(vi dp,vvi mt,int n){
    vi res(n);
    rep(i,n)rep(j,n)res[i]+=mt[i][j]*dp[j]%mod;
    rep(i,n)res[i]%=mod;
    return res;
}
vvi update(vvi mt,int n){
    vvi res(n,vi(n));
    rep(i,n)rep(j,n)rep(k,n)res[i][j]+=mt[i][k]*mt[k][j]%mod;
    rep(i,n)rep(j,n)res[i][j]%=mod;
    return res;
}
void matpow(vi &dp,vvi mt,ll k,int n){
    while(k){
        if(k&1)dp=matmul(dp,mt,n);
        mt=update(mt,n);
        k>>=1;
    }
}
/*
int main(){
    ll n,k;cin>>n>>k; //nは分かってる項数、kは求めたいのが何項目か
    vi dp(n);
    rep(i,n)cin>>dp[n-i-1];
    if(k<=n)dame(dp[n-k]); //分かっている
    vvi mt(n,vi(n));
    rep(i,n)cin>>mt[0][i]; //遷移の式
    REP(i,1,n)mt[i][i-1]=1; //こうすると上手くいく
    matpow(dp,mt,k-n,n);
    out(dp[0]);
}
*/

//ABC009D 漸化式
int main(){
    ll n,m,k;cin>>n>>m>>k;
    vvi mt(n,vi(n));
    vi dp(n);rep(i,n)cin>>dp[i];
    ll tmp=modpow(m,mod-2);
    ll tmp2=modpow(2,mod-2);
    rep(i,m){
        ll a,b;cin>>a>>b;a--;b--;
        mt[a][b]=tmp2;
        mt[b][a]=tmp2;
    }
    rep(i,n){
        ll sum=0;
        rep(j,n)sum+=mt[i][j];
        mt[i][i]=(m+mod-sum%mod)%mod;
    }
    rep(i,n)rep(j,n)mt[i][j]=mt[i][j]*tmp%mod;
    matpow(dp,mt,k,n);
    for(ll x:dp)out(x);
}