#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) {
			ll tmp = 0;
			rep(z, N) {
				tmp += mae[x][z] * (ll)mae[z][y] % mod;
			}
			ato[x][y] = tmp % mod;
		}
		swap(mae, ato);

		if (K >> 29 - i & 1) {
			rep(x, N) rep(y, N) {
				ll tmp = 0;
				rep(z, N) {
					tmp += mae[x][z] * (ll)dp[0][z][y] % 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;
}
/*
 * @date:2021-04-24 20:37:33
 * @source:
*/
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 100 + 5;
const int MOD = 1e9 + 7;

int N, M, K;
long long A[MAXN];
int Num[MAXN];

struct Matrix {
    long long A[MAXN][MAXN];
    Matrix() {
        memset(A, 0, sizeof A);
    }
} a, c;

Matrix mul(const Matrix &x, const Matrix &y) {
    memset(c.A, 0, sizeof c.A);
    for (int i = 1; i <= N; ++i) {
        for (int j = 1; j <= N; ++j) {
            for (int k = 1; k <= N; ++k) {
                c.A[i][j] = (c.A[i][j] + x.A[i][k] * y.A[k][j] % MOD) % MOD;
            }
        }
    }
    return c;
}

long long poww(long long x, int t) {
    long long res = 1;
    for (; t; t >>= 1) {
        if (t & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

Matrix poww(Matrix &x, int t) {
    Matrix res = x;
    for (--t; t; t >>= 1) {
        if (t & 1) res = mul(res, x);
        x = mul(x, x);
    }
    return res;
}

int main() {
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i) scanf("%lld", &A[i]);
    if (!K) {
        for (int i = 1; i <= N; ++i) {
            printf("%lld\n", A[i]);
        }
        return 0;
    }
    long long p = poww(M, MOD - 2), two = poww(2, MOD - 2);
    for (int i = 1, u, v; i <= M; ++i) {
        scanf("%d%d", &u, &v);
        ++Num[u], ++Num[v];
        a.A[u][v] = a.A[v][u] = p * two % MOD;
    }
    for (int i = 1; i <= N; ++i) {
        a.A[i][i] = p * (M - Num[i] + two * Num[i]) % MOD;
    }
    a = poww(a, K);
    for (int i = 1; i <= N; ++i) {
        long long x = 0;
        for (int j = 1; j <= N; ++j) {
            x = (x + A[j] * a.A[i][j]) % MOD;
        }
        printf("%lld\n", x);
    }
    return 0;
}