/*
  Problem Name:Graph Smoothing
  algorithm tag:矩阵快速幂
*/

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-4;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
//#define x first
//#define y second
#define iosf ios::sync_with_stdio(false), cin.tie(0), cout << fixed

const int N = 110;

typedef long long ll;

int n;

struct Matrix
{
    int a[N][N];
    Matrix() { memset(a, 0, sizeof(a)); }
    int *operator[](int x)
    {
        return a[x];
    }
    Matrix operator*(Matrix b)
    {
        Matrix res;
        for (int k = 1; k <= n; k++)
            for (int i = 1; i <= n; i++)
                for (int j = 1; j <= n; j++)
                    res[i][j] = (res[i][j] + (ll)a[i][k] * b[k][j]) % mod;
        return res;
    }
} E;

Matrix Pow(Matrix x, int y)
{
    Matrix res = E;
    for (; y; y >>= 1, x = x * x)
        if (y & 1)
            res = res * x;
    return res;
}

int Pow(int x, int y)
{
    int res = 1;
    for (; y; y >>= 1, x = (ll)x * x % mod)
        if (y & 1)
            res = (ll)res * x % mod;
    return res;
}

int ind[N], A[N];

int main()
{
    int m, k;
    scanf("%d%d%d", &n, &m, &k);
    int inv = Pow(2 * m, mod - 2);
    for (int i = 1; i <= n; i++)
        scanf("%d", &A[i]);
    for (int i = 1; i <= n; i++)
        E[i][i] = 1;
    Matrix base;
    for (int i = 1; i <= m; i++) {
        int a, b;
        scanf("%d%d", &a, &b), ind[a]++, ind[b]++;
        base[a][a] = base[b][b] = base[a][b] = base[b][a] = inv;
    }
    for (int a = 1; a <= n; a++) {
        base[a][a] = (ll)(2 * m - ind[a]) * inv % mod;
    }
    base = Pow(base, k);
    for (int i = 1; i <= n; i++) {
        int res = 0;
        for (int j = 1; j <= n; j++)
            res = (res + (ll)A[j] * base[j][i]) % mod;
        printf("%d\n", res);
    }
}
#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[2][100][100];
int AB[200], *A = AB, *B = AB + 100;
ll uke[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;
	rep(i, N) {
		cin >> A[i];
	}
	auto mae = dp[0], ato = dp[1];
	rep(i, N) uke[i][i] = 1;
	int are = modpow(2 * M, mod - 2);

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

	const ll ma = (1ll << 32) - 1;

	rep(i, 30) {
		if (K >> i & 1) {
			rep(i, N) {
				ll t1 = 0, t2 = 0;
				rep(j, N) {
					auto tmp = (ll)mae[i][j] * A[j];
					t1 += tmp >> 32;
					t2 += tmp & ma;
				}
				B[i] = ((t1 % mod << 32) + t2) % mod;
			}
			swap(A, B);
		}
		if (!K | i >= 31 - __builtin_clz(K)) break;
		rep(x, N) rep(y, x + 1) {
			auto tmp1 = mae[x];
			auto tmp2 = mae[y];
			ll t1 = 0, t2 = 0;
			rep(z, N) {
				auto tmp = *tmp1++ * (ll)*tmp2++;
				t1 += tmp >> 32;
				t2 += tmp & ma;
			}
			ato[y][x] = (ato[x][y] = ((t1 % mod << 32) + t2) % mod);
		}
		swap(mae, ato);
	}

	rep(i, N) co(A[i]);


	Would you please return 0;
}