#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
int dp[3][100][100];
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N, M, K;
	cin >> N >> M >> K;
	int A[100];
	rep(i, N) {
		cin >> A[i];
	}
	rep(i, N) dp[0][i][i] = 1;
	rep(i, N) dp[1][i][i] = 1;
	int are = modpow(2 * M, mod - 2);

	rep(i, M) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		(dp[0][x][x] += mod - are) %= mod;
		(dp[0][x][y] += are) %= mod;
		(dp[0][y][x] += are) %= mod;
		(dp[0][y][y] += mod - are) %= mod;
	}

	auto mae = dp[1], ato = dp[2];
	rep(i, 30) {
		rep(x, N) rep(y, N) {
			unsigned long long tmp = 0;
			rep(z, N) {
				tmp += mae[x][z] * (ll)mae[z][y];
				if (!(z & 15)) tmp %= mod;
			}
			ato[x][y] = tmp % mod;
		}
		swap(mae, ato);

		if (K >> 29 - i & 1) {
			rep(x, N) rep(y, N) {
				unsigned long long tmp = 0;
				rep(z, N) {
					tmp += mae[x][z] * (ll)dp[0][z][y];
					if (!(z & 15)) tmp %= mod;
				}
				ato[x][y] = tmp % mod;
			}
			swap(mae, ato);
		}
	}

	rep(i, N) {
		ll kotae = 0;
		rep(j, N) kotae += (ll)mae[i][j] * A[j] % mod;
		co(kotae % mod);
	}


	Would you please return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=25,INF=1<<30;

typedef vector<vector<ll>> mat;

mat mul(mat &A, mat&B){
    mat C(A.size(),vector<ll>(B[0].size()));
    for(int i=0;i<A.size();i++){
        for(int k=0;k<B.size();k++){
            for(int j=0;j<B[0].size();j++){
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])%mod;
            }
        }
    }
    return C;
}

mat pow(mat A,ll n){
    mat B(A.size(),vector<ll>(A.size()));
    for(int i=0;i<A.size();i++){
        B[i][i]=1;
    }
    
    while(n>0){
        if(n&1) B=mul(B,A);
        A=mul(A,A);
        n/=2;
    }
    return B;
}

ll rui(ll a,ll b){
    ll ans=1;
    while(b>0){
        if(b&1) ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,M,K;cin>>N>>M>>K;
    
    mat B(N,vector<ll>(1));
    for(int i=0;i<N;i++){
        cin>>B[i][0];
    }
    
    mat A(N,vector<ll>(N));
    for(int i=0;i<N;i++) A[i][i]=1;
    
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;
        a--;b--;
        if(a==b) continue;
        
        A[a][a]-=rui(M*2,mod-2);
        A[b][b]-=rui(M*2,mod-2);
        
        A[a][b]+=rui(M*2,mod-2);
        A[b][a]+=rui(M*2,mod-2);
        
        if(A[a][a]<0) A[a][a]+=mod;
        if(A[b][b]<0) A[b][b]+=mod;
        
        A[a][b]%=mod;
        A[b][a]%=mod;
    }
    
    A=pow(A,K);
    A=mul(A,B);
    
    for(int i=0;i<N;i++) cout<<A[i][0]<<endl;
}
