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

long long int MOD = 1000000007;

void mult(vector<vector<long long int>> &a, vector<vector<long long int>> &b, int n) {
    vector<vector<long long int>> c(n, vector<long long int>(n, 0));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < n; k++) {
                c[i][j] += a[i][k] * b[k][j];
                c[i][j] %= MOD;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            a[i][j] = c[i][j];
        }
    }
}

void bin_mat(vector<vector<long long int>> &m, long long int e, int n, vector<vector<long long int>> &temp) {
    if (e == 0)
        return;
    if (e == 1)
        return;
    
    bin_mat(m, e / 2, n, temp);
    mult(m, m, n);
    if (e % 2)
        mult(m, temp, n);
}

long long int bin_pow(long long int b, long long int e) {
    if (e == 0) return 1;

    long long int temp = bin_pow(b, e / 2);
    temp = temp * temp % MOD;
    if (e % 2)
        return temp * b % MOD;
    return temp;
}

void solve() {
    int n,m,k; cin >> n >> m >> k;
    vector<long long int> num(n);
    for (int i = 0; i < n; i++) {
        cin >> num[i];
    }
    vector<vector<int>> graph(n);
    for (int i = 0; i < m; i++) {
        int a,b; cin >> a >> b;
        a--; b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    vector<vector<long long int>> mat(n, vector<long long int>(n, 0));

    for (int i = 0; i < n; i++) {
        int cnt = m - graph[i].size();
        mat[i][i] += 2 * cnt % MOD;
        for (auto j: graph[i]) {
            mat[i][i]++;
            mat[i][j]++;
        }
    }
    vector<vector<long long int>> temp = mat;
    bin_mat(mat, k, n, temp);

    if (k > 0) {
        vector<long long int> ans(n, 0);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                ans[i] += mat[i][j] * num[j] % MOD;
                ans[i] %= MOD;
            }
        }

        long long int val = bin_pow(2 * m, k);
        val = bin_pow(val, MOD - 2);
        for (int i = 0; i < n; i++) {
            cout << ans[i] * val % MOD << '\n';
        }
    } else {
        for (int i = 0; i < n; i++)
            cout << num[i] % MOD << '\n';
    }

}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
    
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
typedef pair<pi,ll> pii;
typedef set <ll> si;
typedef long double ld;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define maxn 101
#define MOD 1000000007
#define int ll

int N,M,K,A[maxn];
//~ int dp[maxn][maxn * 10];
//~ vi adj[maxn];

ll qexp(ll x, ll y) { 
ll res = 1; 
while (y > 0){
if (y & 1){
res = res*x; 
			res %= MOD;
        		}
        		y = y>>1;
        		x = x*x; 
        		x %= MOD;
} 
    return res; 
}

int modinv(int A,int B){
	A %= MOD;
	B = qexp(B,MOD-2);
	A *= B;
	A %= MOD;
	return A;
}


//~ int dpf(int i,int j){
	//~ if (j == 0) return A[i];
	//~ if (dp[i][j] != -1) return dp[i][j];
	//~ dp[i][j] = 0;
	//~ aFOR(k,adj[i]){
		//~ dp[i][j] += modinv((dpf(i,j-1) + dpf(k,j-1)) % MOD, 2);
	//~ }
	//~ dp[i][j] += (dpf(i,j-1) * (M - adj[i].size())) % MOD;
	//~ dp[i][j] = modinv(dp[i][j], M);
	//~ return dp[i][j];
//~ }
	
struct Matrix{
	ll a[101][101];
	Matrix(){
		FOR(i,1,N) FOR(j,1,N) a[i][j] = 0;
	}
	
	Matrix operator *(Matrix other){
		Matrix product = Matrix();
		FOR(i,1,N) FOR(j,1,N) FOR(k,1,N){
			product.a[i][k] += (a[i][j] * other.a[j][k]) % MOD;
			product.a[i][k] %= MOD;
		}
		return product;
	}
};

Matrix mat_exp(Matrix mat, int k){
	Matrix ans = Matrix();
	FOR(i,1,N) ans.a[i][i] = 1;
	while (k > 0){
		if (k % 2 == 1){
			ans = ans * mat;
		}
		mat = mat * mat;
		k /= 2;
	}
	return ans;
}




int32_t main(){
	fast;
	
	cin >> N >> M >> K;
	FOR(i,1,N) cin >> A[i];
	
	Matrix mat = Matrix();
	FOR(i,1,M){
		int x,y;
		cin >> x >> y;
		//~ adj[x].pb(y); adj[y].pb(x);
		mat.a[x][y] = mat.a[y][x] = 1;
		mat.a[x][x]++; mat.a[y][y]++;
	}
	FOR(i,1,N){
		mat.a[i][i] = (2 * M - mat.a[i][i]) % MOD;
		mat.a[i][i] = (mat.a[i][i] + MOD) % MOD;
	}
	Matrix res = mat_exp(mat, K);
	//~ cout << K << '\n';
	//~ FOR(i,1,N){
		//~ FOR(j,1,N) cout << res.a[i][j] << ' ';
		//~ cout << '\n';
	//~ }
	
	//~ return 0;
	int k = qexp((2 * M) % MOD, K);
	
	FOR(i,1,N){
		int ans = 0;
		FOR(j,1,N){
			ans += (res.a[i][j] * A[j]) % MOD; ans %= MOD;
		}
		cout << modinv(ans, k) << '\n';
	}
	//~ mem(dp,-1);
	//~ FOR(i,1,N){
		//~ cout << dpf(i,K) << '\n';
	//~ }
	
}

