#include<bits/stdc++.h>
#define LL long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
int read(){
	char ch=getchar(); int x=0,fl=1;
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') fl=-1;
	for(;isdigit(ch);ch=getchar()) x=(x<<3)+(x<<1)+(ch-'0');
	return x*fl;
}
const int N=105;
const int M=10005;
const LL mod=1e9+7,iv2=(mod+1)/2LL;

int n,m,k,a[N];
LL f[N],g[N],mt[N][N][31];
vector<int> adj[N];
LL fastpow(LL x,LL y){
	LL res=1LL;
	for(;y;y>>=1,x=x*x%mod) if(y&1) res=res*x%mod;
	return res;
}
void upd(LL &x,LL y){
	x=(x+y)%mod;
}

int main(){
	n=read(); m=read(); k=read();
	for(int i=1;i<=n;i++) a[i]=f[i]=read();
	for(int i=1;i<=m;i++){
		int x=read(),y=read();
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	LL ivm=fastpow(m,mod-2);
	for(int i=1;i<=n;i++){
		int sz=adj[i].size();
		upd(mt[i][i][0],m-sz);
		for(int j=0;j<sz;j++){
			int y=adj[i][j];
			upd(mt[i][i][0],iv2);
			upd(mt[y][i][0],iv2);
		}
	}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++) mt[i][j][0]=1LL*mt[i][j][0]*ivm%mod;
	for(int t=1;t<=30;t++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				for(int md=1;md<=n;md++) upd(mt[i][j][t],1LL*mt[i][md][t-1]*mt[md][j][t-1]%mod);
	for(int t=0;t<=30;t++){
		if(k&(1<<t)){
			for(int i=1;i<=n;i++) g[i]=0LL;
			for(int i=1;i<=n;i++)
				for(int j=1;j<=n;j++) upd(g[j],1LL*f[i]*mt[i][j][t]%mod);
			for(int i=1;i<=n;i++) f[i]=g[i];
		}
	}
	for(int i=1;i<=n;i++){
		cout<<1LL*f[i]%mod<<'\n';
	}
	return 0;
}

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

#define mp make_pair
#define pb push_back
#define ll long long int
#define sd(x) scanf("%lld",&x)
#define inf 1e18+9
#define pll pair<ll,ll>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define bits(x) __builtin_popcountll(x)
#define ld long double
#define test() ll test; cin>>test; while(test--)
#define fi first
#define se second

inline ll GCD(ll x, ll y) {
    if(x<y) swap(x,y);
    if(x==0) return y;
    if(y==0) return x;
    return GCD(x%y,y);
}

ll phi(ll n) {
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            while(n % i == 0)
                n /= i;
            result -= result / i;
        }
    }
    if(n > 1)
        result -= result / n;
    return result;
}

ll power(ll x, ll n, ll mod) {
    ll res = 1;
    x %= mod;
    while(n) {
        if(n&1) {
            res = ((res*x)%mod+mod)%mod;
        }
        x = ((x*x)%mod+mod);
        n>>=1;
    }

    return res;
}

const int MOD = 1e9+7;
const int MAXN = 105;

inline ll add(ll x, ll y, ll mod) {
    ll ans = (x+y+mod)%mod;
    return ans;
}

inline ll multiply(ll x, ll y, ll mod) {
    x %= mod;
    y %= mod;
    ll ans = ((x*y)%mod+mod)%mod;
    return ans;
}

int N,M,K;

struct matrix{
    vector<vector<ll> > mat;
    int n;
    int m;
    matrix(int n, int m):n(n),m(m) { // in this case m=n
        mat.clear();
        mat.assign(n,vector<ll>(m,0));
    }

    void mul(matrix b) {
        vector<vector<ll> > c(MAXN,vector<ll>(MAXN,0));

        for(int i=1;i<=N;i++) {
            for(int j=1;j<=N;j++) {
                for(int k=1;k<=N;k++) {
                    c[i][j] = add(c[i][j],multiply(this->mat[i][k],b.mat[k][j],MOD),MOD);
                }
            }
        }

        this->mat = c;
    }
};


vector<int> graph[MAXN];
ll A[MAXN];
matrix mat(MAXN,MAXN);
matrix iden(MAXN,MAXN);

void matExpo(int n) {
    for(int i=1;i<=N;i++) {
        iden.mat[i][i] = 1;
    }

    while(n) {
        if(n&1) {
            iden.mul(mat);
        }
        mat.mul(mat);
        n>>=1;
    }
}

int main() {
    fastio;

    cin>>N>>M>>K;
 
    for(int i=1;i<=N;i++) {
        cin>>A[i];
    }

    ll p2 = power(2,MOD-2,MOD);
    ll pm = power(M,MOD-2,MOD);

    vector<int> deg(N+1,0);
    int x,y;
    for(int i=0;i<M;i++) {
        cin>>x>>y;
        // mat.mat[x][x] += ((ld)1/(ld)2.0);
        // mat.mat[x][y] += ((ld)1/(ld)2.0);
        // mat.mat[y][x] += ((ld)1/(ld)2.0);
        // mat.mat[y][y] += ((ld)1/(ld)2.0);
        mat.mat[x][x] += p2;
        mat.mat[x][y] += p2;
        mat.mat[y][x] += p2;
        mat.mat[y][y] += p2;
        deg[x]++,deg[y]++;
    }
 
    for(int i=1;i<=N;i++) {
        mat.mat[i][i] += (M-deg[i]);
    }


    for(int i=1;i<=N;i++) {
        for(int j=1;j<=N;j++) {
            mat.mat[i][j] = multiply(mat.mat[i][j],pm,MOD);
        }
    }

    matExpo(K);
    
    vector<ll> ans(N+1);

    for(int i=1;i<=N;i++) {
        for(int j=1;j<=N;j++) {
            ans[i] = add(ans[i],multiply(iden.mat[i][j],A[j],MOD),MOD);
        }
        cout<<ans[i]<<'\n';
    }
}




