#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
int mod = 1000000007;
int add(int x, int y) { return (x += y) >= mod ? x - mod : x; }
template<class... T> int add(int x, T... y) { return add(x, add(y...)); }
int mul(int x, int y) { return 1LL * x * y % mod; }
template<class... T> int mul(int x, T... y) { return mul(x, mul(y...)); }
int sub(int x, int y) { return add(x, mod - y); }
int modpow(int a, long long b) {
    int ret = 1; while (b > 0) {
        if (b & 1) ret = 1LL * ret * a % mod; a = 1LL * a * a % mod; b >>= 1;
    } return ret;
}
int modinv(int a) { return modpow(a, mod - 2); }
typedef vector<int> Vec;
typedef vector<Vec> Mat;
Vec mulMatVec(Mat a, Vec b)
{
    int n = b.size(); Vec ret(n, 0);
    rep(i, 0, n) rep(j, 0, n) ret[i] = add(ret[i], mul(a[i][j], b[j]));
    return ret;
}
Mat mulMatMat(Mat a, Mat b)
{
    int n = a.size(); Mat ret(n, Vec(n, 0));
    rep(i, 0, n) rep(j, 0, n) rep(k, 0, n) ret[i][j] = add(ret[i][j], mul(a[i][k], b[k][j]));
    return ret;
}
Mat fastpow(Mat x, ll n)
{
    Mat ret(x.size(), Vec(x.size(), 0));
    rep(i, 0, x.size()) ret[i][i] = 1;
    while (0 < n) { if ((n % 2) == 0) { x = mulMatMat(x, x); n >>= 1; } else { ret = mulMatMat(ret, x); --n; } }
    return ret;
}
void printVec(Vec a) { cout << "[\t"; rep(i, 0, a.size()) cout << a[i] << "\t"; cout << "]" << endl; }
void printMat(Mat a) { rep(i, 0, a.size()) printVec(a[i]); }
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N, M, K, A[101];
int X[10101], Y[10101];
int cnt[101];
bool E[101][101];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> M >> K;
	rep(i, 0, N) cin >> A[i];
    rep(i, 0, M) cin >> X[i] >> Y[i], X[i]--, Y[i]--;

    Mat Ma(N, Vec(N));
	rep(i, 0, M) {
        cnt[X[i]]--;
        cnt[Y[i]]--;
        E[X[i]][Y[i]] = E[Y[i]][X[i]] = true;
	}

    rep(to, 0, N) {
        int cnt = M;
        rep(from, 0, N) if (to != from) {
            if (E[to][from]) {
                Ma[to][to] = add(Ma[to][to], mul(modinv(M), modinv(2)));
                Ma[to][from] = add(Ma[to][from], mul(modinv(M), modinv(2)));
                cnt--;
            }
        }
        Ma[to][to] = add(Ma[to][to], mul(cnt, modinv(M)));
    }

    Vec v(N, 0);
    rep(i, 0, N) v[i] = A[i];
    
    Ma = fastpow(Ma, K);
    v = mulMatVec(Ma, v);
    rep(i, 0, N) cout << v[i] << endl;
}






#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N = 110;

struct Mat {
	int t[N][N];
};

int n, m, k;
int a[N], ans[N], sz[N];

Mat mul(Mat a, Mat b) {
	Mat c;
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) {
			c.t[i][j] = 0;
			for(int k=1; k<=n; k++) {
				c.t[i][j] = (c.t[i][j]+(ll)a.t[i][k]*b.t[k][j])%mod;
			}
		}
	}
	return c;
}

Mat qpow(Mat a, int b) {
	Mat res;
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) {
			if(i==j)
				res.t[i][j] = 1;
			else
				res.t[i][j] = 0;
		}
	}
	while(b) {
		if(b&1)
			res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

int main() {
	scanf("%d%d%d", &n, &m, &k);
	for(int i=1; i<=n; i++)
		scanf("%d", &a[i]);
	int inv = powmod(2*m, mod-2);
	Mat A;
	memset(A.t, 0, sizeof(A.t));
	for(int i=1; i<=m; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		sz[u]++; sz[v]++;
		A.t[u][v] = A.t[v][u] = inv;
	}
	for(int i=1; i<=n; i++)
		A.t[i][i] = (ll)(m*2-sz[i])*inv%mod;
	// for(int i=1; i<=n; i++) {
	// 	for(int j=1; j<=n; j++) {
	// 		printf("%d ", A.t[i][j]);
	// 	}
	// 	printf("\n");
	// }
	A = qpow(A, k);
	// for(int i=1; i<=n; i++) {
	// 	for(int j=1; j<=n; j++) {
	// 		printf("%d ", A.t[i][j]);
	// 	}
	// 	printf("\n");
	// }
	// printf("val=%lld\n", powmod(2, mod-2));
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) {
			ans[j] = (ans[j]+(ll)A.t[i][j]*a[i])%mod;
		}
	}
	for(int i=1; i<=n; i++)
		printf("%d\n", ans[i]);
	// printf("\n");
	return 0;
}