#include "bits/stdc++.h"
#define ll long long
#define lld long double
#define MOD 1000000007
#define inf 1000000000000000000LL
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll power(ll x,ll y, ll md=MOD){ll res = 1;x%=md;while(y){if(y&1)res = (res*x)%md;x *= x; if(x>=md) x %= md; y >>= 1;}return res;}
 
using namespace std;

#define endl '\n'
#define int long long

struct node {vector<ll> v,w;};

ll mod(ll &x,ll md=MOD){x=(x%md + md)%md;return x;}
ll mod(ll &&x,ll md=MOD){x=(x%md + md)%md;return x;}

#define mm 101

void multiply(int a[][mm], int b[][mm], int dim) {
  int c[mm][mm];
  for (int i = 0; i < dim; i++) {

    for (int j = 0; j < dim; j++) {
      int sum = 0;
      for (int k = 0; k < dim; k++) {
        sum += a[i][k] * b[k][j];
        mod(sum);
      }

      c[i][j] = sum;
    }
  }
  for (int i = 0; i < dim; i++) {
    for (int j = 0; j < dim; j++) {
      a[i][j] = c[i][j];
    }
  }
}

void matrixexponentiation(int arr[mm][mm], int dim, int power) {
  int I[mm][mm];
  for (int i = 0; i < dim; i++) {
    for (int j = 0; j < dim; j++) {
      if (i == j) {
        I[i][j] = 1;
      } else {
        I[i][j] = 0;
      }
    }
  }
  while (power != 1) {
    if (power % 2) {
      multiply(I, arr, dim);
      power--;
    } else {
      multiply(arr, arr, dim);
      power /= 2;
    }

  }
  multiply(arr, I, dim);
}

	int arr[101][101];
signed main() {
	fast;

	int n,m,k;
	cin>>n>>m>>k;

	vector<node> nodes(n);

	vector<int> a(n);
	for(auto &x: a) cin>>x;

	if(k==0) {
		for(auto x: a) cout<<x<<" ";
			exit(0);
	}

	set<pii> ed;

	vector<pii> q(m);
	for(int i=0;i<m;i++) {
		int u,v;
		cin>>u>>v;
		u--; v--;
		nodes[u].v.pb(v);
		nodes[v].v.pb(u);
		ed.insert({u,v});
		ed.insert({v,u});
	}


	for(int i=0;i<n;i++) {
		int num = nodes[i].v.size();
		arr[i][i] = 1 - (num) * power(2*m, MOD-2);
		mod(arr[i][i]);

		// cout<<(2*num + m)<<"/"<<2*num + 2*m<<endl;

		for(int j=0;j<n;j++) {
			if(j==i) continue;

			if(ed.count({i,j})) {
				arr[i][j] = power(2*m, MOD-2);
				// cout<<"#"<<i<<" "<<j<<" -- "<<2*num + 2*m<<endl;
			}
		}
	}

	// for(int i=0;i<n;i++) {
	// 	for(int j=0;j<n;j++) {
	// 		cout<<arr[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }

	matrixexponentiation(arr, n, k);


	for(int i=0;i<n;i++) {

		int val = 0;
		for(int j=0;j<n;j++) {
			val += mod(a[j] * arr[i][j]);
		}
		cout<<mod(val)<<endl;
	}


}
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#define ll long long
#define MAXN 300005
#define uns unsigned
#define INF 0x3f3f3f3f
#define MOD 1000000007ll
using namespace std;
inline ll read(){
	ll x=0;bool f=1;char s=getchar();
	while((s<'0'||s>'9')&&s>0){if(s=='-')f^=1;s=getchar();}
	while(s>='0'&&s<='9')x=(x<<1)+(x<<3)+s-'0',s=getchar();
	return f?x:-x;
}
inline ll ksm(ll a,ll b,ll mo){
	ll res=1;
	for(;b;b>>=1,a=a*a%mo)if(b&1)res=res*a%mo;
	return res;
}
struct matrix{
	int n,m;
	ll c[105][105];
	matrix(){memset(c,0,sizeof(c)),n=m=0;}
	matrix operator*(const matrix&b){
		matrix res;res.n=n,res.m=b.m;
		for(int i=1;i<=n;i++)
			for(int k=1;k<=m;k++)
				for(int j=1;j<=b.m;j++)
					res.c[i][j]=(res.c[i][j]+c[i][k]*b.c[k][j]%MOD)%MOD;
		return res;
	}
}a,b;
inline matrix mpow(matrix a,ll b){
	matrix res;res.n=res.m=a.n;
	for(int i=1;i<=res.n;i++)res.c[i][i]=1;
	for(;b;b>>=1,a=a*a)if(b&1)res=res*a;
	return res;
}
int n,m,k,du[105];
bool G[105][105];
int main()
{
	n=read(),m=read(),k=read();
	a.n=1,a.m=n,b.n=b.m=n;
	for(int i=1;i<=n;i++)a.c[1][i]=read();
	for(int i=1;i<=m;i++){
		int u=read(),v=read();
		G[u][v]=G[v][u]=1,du[u]++,du[v]++;
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			if(G[i][j])
				b.c[j][i]=(b.c[j][i]+ksm(m<<1,MOD-2,MOD))%MOD,
				b.c[i][i]=(b.c[i][i]+ksm(m<<1,MOD-2,MOD))%MOD;
		b.c[i][i]=(b.c[i][i]+ksm(m,MOD-2,MOD)*(m-du[i])%MOD)%MOD;
	}
	a=a*mpow(b,k);
	for(int i=1;i<=n;i++)printf("%lld\n",a.c[1][i]);
	return 0;
}