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

const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y){
    int64_t d = a;
    if(b != 0){
        d = extgcd(b, a%b, y, x);
        y -= (a/b) * x;
    }else{
        x = 1; y = 0;
    }
    return d;
}

int64_t inv_mod(int64_t a){
    int64_t x, y;
    extgcd(a, MOD, x, y);
    return (MOD + x%MOD) % MOD;
}

typedef vector<vector<int64_t>> Mat;

Mat matmul(Mat A, Mat B){
    assert(A[0].size() == B.size());
    int N = A.size(), M = B[0].size(), K = B.size();
    Mat ans(N, vector<int64_t>(M));
    for(int i=0; i<N; i++) for(int j=0; j<M; j++) for(int k=0; k<K; k++) add(ans[i][j], A[i][k] * B[k][j]);
    return ans;
}

int main(){
    int N, M, K;
    cin >> N >> M >> K;
    vector<vector<int64_t>> A(N, vector<int64_t>(1));
    for(int i=0; i<N; i++) cin >> A[i][0];
    vector<vector<int>> edges(N);
    for(int i=0; i<M; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    int64_t inv2M = inv_mod(2*M);
    vector<vector<int64_t>> X(N, vector<int64_t>(N));
    for(int i=0; i<N; i++){
        X[i][i] = 1;
        for(int j : edges[i]){
            X[j][i] = inv2M;
            add(X[i][i], MOD-inv2M);
        }
    }

    while(K > 0){
        if(K%2) A = matmul(X, A);
        X = matmul(X, X);
        K /= 2;
    }
    for(auto a : A) cout << a[0] << endl;
    return 0;
}

/* stuff you should look for
	* int overflow, array bounds, uppercase/lowercase
	* special cases (n=1?)
	* do sth. instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/
#include<cstdio>
const int mod=1e9+7;
int n,cnt,deg[105];
int h[105],to[20005],ver[20005];
struct matrix {
	int a[105][105];
}A,trans;
inline matrix operator*(const matrix &x,const matrix &y) {
	matrix res;
	for(register int i=1;i<=n;++i) {
		for(register int j=1;j<=n;++j) {
			int ans=0;
			for(register int k=1;k<=n;++k) {
				ans+=x.a[i][k]*1ll*y.a[k][j]%mod;
				if(ans>=mod) ans-=mod;
			}
			res.a[i][j]=ans;
		}
	}
	return res;
} 
inline matrix operator^(matrix x,int p) {
	matrix res;
	for(register int i=1;i<=n;++i) {
		for(register int j=1;j<=n;++j) res.a[i][j]=0;
		res.a[i][i]=1;
	}
	for(;p;p>>=1) {if(p&1) res=res*x; x=x*x;}
	return res;
}
inline int read() {
	register int x=0,f=1;register char s=getchar();
	while(s>'9'||s<'0') {if(s=='-') f=-1;s=getchar();}
	while(s>='0'&&s<='9') {x=x*10+s-'0';s=getchar();}
	return x*f;
}
inline void add(int x,int y) {to[++cnt]=y;ver[cnt]=h[x];h[x]=cnt;}
inline int pow(int x,int p) {int res=1;for(;p;p>>=1) {if(p&1) res=res*1ll*x%mod; x=x*1ll*x%mod;}return res;}
int main() {
	n=read(); int m=read(),K=read();
	for(register int i=1;i<=n;++i) A.a[1][i]=read();
	for(register int i=1;i<=m;++i) {
		int x=read(),y=read();
		++deg[x]; ++deg[y]; add(x,y); add(y,x); 
	}
	int inv2=pow(2,mod-2),invm=pow(m,mod-2);
	for(register int i=1;i<=n;++i) {
		trans.a[i][i]=mod+1-deg[i]*1ll*invm%mod*inv2%mod;
		for(register int k=h[i];k;k=ver[k]) {
			int y=to[k];
			trans.a[y][i]=invm*1ll*inv2%mod;
		}
	} 
	matrix res=A*(trans^K);
	for(register int i=1;i<=n;++i) printf("%d\n",res.a[1][i]);
	return 0;
}
