#include <bits/stdc++.h>
using namespace std;
#define int long long
namespace math{
    const int MOD = 1e9+7;
    const int MN = 10'100;
    int fact[MN], inv_fact[MN];
    int power(int a, int n) {
        int res = 1;
        for (;n; n >>= 1, a = (a * a) % MOD) if (n & 1) res = (res * a) % MOD;
        return res;
    }
    int inv(int a) { return inv_fact[a]*fact[a-1]%MOD; }
    void init_fact() {
        fact[0]=1;
        for (int i=1;i<MN;++i) fact[i] = fact[i-1]*i%MOD;
        inv_fact[MN-1] = power(fact[MN-1], MOD - 2);
        for (int i=MN-1; i>0;--i) inv_fact[i-1]=inv_fact[i]*i%MOD;
    }
    struct mint {
        int n;
        mint(int n): n(n){}
        mint(): n(0){}
        mint operator+(mint o){return (n + o.n) % MOD;}
        mint operator-(mint o){return (n - o.n % MOD + MOD) % MOD;}
        mint operator*(mint o){return (n * o.n) % MOD;}
        mint operator/(mint o){return o.n >= MN ? n * power(o.n, MOD - 2) % MOD : n * inv(o.n) % MOD;}
    };
};
using namespace math;
using mat = vector<vector<mint>>;
int n, m, k;
vector<int> g[100];
mat M;
mat operator*(mat A, mat B)
{
    mat ret(A.size(), vector<mint>(B[0].size()));
    for (int i = 0; i < A.size(); ++i)
    {
        for (int j = 0; j < B[0].size(); ++j)
        {
            for (int k = 0; k < B.size(); ++k)
                ret[i][j] = ret[i][j] + A[i][k] * B[k][j];
        }
    }
    return ret;
}
mat power(mat A, int n)
{
    mat ret(A.size(), vector<mint>(A.size()));
    for (int i = 0;  i < A.size(); ++i)
        ret[i][i] = 1;
    for (; n; A = A * A, n >>= 1)
    {
        if (n & 1) ret = ret * A;
    }
    return ret;
}
signed main()
{
    cin.tie(0)->sync_with_stdio(false);
    cin>>n>>m>>k;
    M.resize(n, vector<mint>(n));
    
    mat A(1, vector<mint>(n));
    for (int i = 0; i< n;++i)
        cin>>A[0][i].n;

    for (int i = 0; i<m;++i)
    {
        int u, v; cin>>u>>v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    init_fact();

    for (int i = 0; i < n;++i)
    {
        M[i][i] = mint(1) - mint(g[i].size()) / m / 2;
        for (int it: g[i])
        {
            M[it][i] = mint(1) / m / 2;

        }
    }

    mat Ans = A * power(M, k);
    for (int i = 0; i<n;++i)
        cout << Ans[0][i].n << '\n';
    return 0;
}
#include<bits/stdc++.h>
#define LL long long
#define rint register int
#define LB lower_bound
#define UB upper_bound
#define MS(x,y) memset(x,y,sizeof(x))
#define rep(i,a,b) for(rint i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(rint i=a,i##end=b;i>=i##end;--i)
#define cms printf("%.2lf\n",(&o2-&o1)/1024.0/1024);
using namespace std;bool o1;
char IO;
inline int Rd(){
	int _s_=0;bool _f_=0;
	while(!isdigit(IO=getchar()))
		(IO=='-')&&(_f_=1);
	do _s_=(_s_<<1)+(_s_<<3)+(IO^48);
	while(isdigit(IO=getchar()));
	return _f_?-_s_:_s_;
}
const int P=1e9+7,n2=5e8+4;
int n,m,k,n2m,a1,b1,in[104];
void cmod(int &x){
	x>=P&&(x-=P);
}
int ksm(int x){
	int rst=1;
	for(rint y=P-2;y;y>>=1,x=1ll*x*x%P)
		(y&1)&&(rst=1ll*rst*x%P);
	return rst;
}
struct node{
	int a[105][105];
	node(){MS(a,0);}
	node operator * (const node &_) const{
		node rst;
		rep(i,1,n)
			rep(j,1,n)
				rep(l,1,n)
					cmod(rst.a[i][j]+=1ll*a[i][l]*_.a[l][j]%P);
		return rst;
	}
}st,nw;
bool o2;int main(){
	n=Rd(),m=Rd(),k=Rd();
	n2m=1ll*ksm(m)*n2%P;
	rep(i,1,n)
		st.a[1][i]=Rd();
	rep(i,1,m){
		in[a1=Rd()]++,in[b1=Rd()]++;
		nw.a[a1][b1]=nw.a[b1][a1]=n2m;
	}
	rep(i,1,n)
		cmod(nw.a[i][i]=P+1-1ll*in[i]*n2m%P);
	rep(i,0,29){
		if(k&(1<<i))
			st=st*nw;
		nw=nw*nw;
	}
	rep(i,1,n)
		printf("%d\n",st.a[1][i]);
	return 0;
}