#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vc = vector<T>;
template<class T> using vvc = vc<vc<T>>;
template<class T> using vvvc = vc<vvc<T>>;
template<class T> using vvvvc = vvc<vvc<T>>;
template<class T> using PQ = priority_queue<T>;
template<class T> using invPQ = priority_queue<T, vector<T>, greater<T>>;
using IP = pair<int, int>;
using LP = pair<ll, ll>;
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); i++)
#define repr(i, n) for (int i = n; (i) >= 0; i--)
#define rep3r(i, m, n) for (int i = (n); (i) >= (int)(m); i--)
template<class T> inline bool chmax(T & a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T & a, T b) { if (a > b) { a = b; return 1; } return 0; }
// constexpr int INF = 1070000000;
// constexpr long long LINF = 4611686015206162431;
constexpr int MOD = 1000000007;
// constexpr long double PI = 3.1415926535897932;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

using vec = vector<ll>;
using mat = vector<vector<ll>>;

mat matmul(mat &A, mat &B) {
    mat C(A.size(), vec(B[0].size()));
    rep (i, A.size()) {
        rep (k, A[0].size()) {
            rep (j, B[0].size()) {
                C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % MOD;
            }
        }
    }
    return C;
}

mat matpow(mat A, ll n) {
    mat B(A.size(), vec(A.size()));
    rep (i, A.size()) B[i][i] = 1;
    while (n > 0) {
        if (n & 1) B = matmul(B, A);
        A = matmul(A, A);
        n >>= 1;
    }
    return B;
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int N, M, K;
    cin >> N >> M >> K;
    mat A(1, vec(N));
    rep (i, N) cin >> A[0][i];
    vvc<int> graph(N);
    rep (i, M) {
        int X, Y;
        cin >> X >> Y;
        X--; Y--;
        graph[X].push_back(Y);
        graph[Y].push_back(X);
    }

    ll invm = modinv(M, MOD), inv2 = modinv(2, MOD);

    mat B(N, vec(N));
    
    rep (j, N) {
        for (int i : graph[j]) {
            B[i][j] = invm * inv2 % MOD;
        }
        B[j][j] = ((M - graph[j].size() + inv2 * graph[j].size()) % MOD) * invm % MOD;
    }

    B = matpow(B, K);
    A = matmul(A, B);
    rep (i, N) {
        cout << A[0][i] << endl;
    }
}
#include <bits/stdc++.h>
using namespace std;
const int N=102;
const int mod=1e9+7;
int n,m,K,v[N],deg[N];
void add(int &x,int y)
{
	(x+=y)>=mod&&(x-=mod);
}
int mul(int x,int y)
{
	return 1ll*x*y%mod;
}
struct mat
{
	int a[N][N];
	mat(int x=0)
	{
		memset(a,0,sizeof a);
		for(int i=1;i<=n;++i)
			a[i][i]=x;
	}
	mat operator *(mat &x)const
	{
		mat res;
		for(int i=1;i<=n;++i)
			for(int j=1;j<=n;++j)
				for(int k=1;k<=n;++k)
					add(res.a[j][k],mul(a[j][i],x.a[i][k]));
		return res;
	}
}f[30];
int power(int x,int y=mod-2)
{
	int res=1;
	for(;y;y>>=1,x=mul(x,x))
		if(y&1)res=mul(res,x);
	return res;
}
int main()
{
	scanf("%d%d%d",&n,&m,&K);
	int inv=mul(power(2),power(m));
	for(int i=1;i<=n;++i)
		scanf("%d",&v[i]);
	for(int i=1,x,y;i<=m;++i)
	{
		scanf("%d%d",&x,&y);
		++deg[x];++deg[y];
		f[0].a[x][y]=f[0].a[y][x]=inv;
	}
	for(int i=1;i<=n;++i)
	{
		f[0].a[i][i]=mul(m-deg[i],inv<<1);
		add(f[0].a[i][i],mul(deg[i],inv));
	}
	for(int i=1;i<30;++i)
		f[i]=f[i-1]*f[i-1];
	mat res(1);
	for(int i=0;i<30;++i)
		if(K>>i&1)res=res*f[i];
	for(int i=1;i<=n;++i)
	{
		int ans=0;
		for(int j=1;j<=n;++j)
			add(ans,mul(v[j],res.a[j][i]));
		printf("%d\n",ans);
	}
}
