#include <bits/stdc++.h>
inline int read( ) {
	int x = 0;
	char c = getchar( );
	while ( !isdigit( c ) ) c = getchar( );
	while ( isdigit( c ) ) {
		x = x * 10 + ( c ^ 48 );
		c = getchar( );
	}
	return x;
}
const int N = 107, mo = 1e9 + 7;
inline int qp( int b, int p ) {
	int ret = 1;
	while ( p ) {
		if ( p & 1 ) ret = 1ll * ret * b % mo;
		b = 1ll * b * b % mo;
		p >>= 1;
	}
	return ret;
}
int n, m, k, a[ N ], deg[ N ];
struct Matrix {
	
	int matrix[101][101];
	
	void clear() { memset(matrix, 0, sizeof(matrix)); }
	
	void I() { for (int i = 0; i <= 100; ++ i) matrix[i][i] = 1; }
	
	
	Matrix operator *(const Matrix &a) const {
		Matrix res;
		res.clear();
		for (int i = 1; i <= n; ++ i) {
			for (int j = 1; j <= n; ++ j) {
				for (int k = 1; k <= n; ++ k) {
					(res.matrix[i][j] += 1ll * matrix[i][k] % mo * a.matrix[k][j] % mo) %= mo;
				}
			}
		}
		return res;
	}
	
}mat, ret;
int main( ) {
	n = read( ), m = read( ), k = read( );
	for ( int i = 1; i <= n; ++ i ) a[ i ] = read( );
	int INV = qp( 2 * m, mo - 2 );
	for ( int i = 1, x, y; i <= m; ++ i ) {
		x = read( ), y = read( );
		++ deg[ x ];
		++ deg[ y ];
		mat.matrix[ x ][ y ] = mat.matrix[ y ][ x ] = INV;
	}
	for ( int i = 1; i <= n; ++ i ) mat.matrix[ i ][ i ] = 1ll * ( 2 * m - deg[ i ] + mo ) % mo * INV % mo;
	for ( int i = 1; i <= n; ++ i ) ret.matrix[ 1 ][ i ] = a[ i ];
	Matrix ans;
	ans.clear();
	ans.I();
	while (k) {
		if (k & 1) ans = ans * mat;
		k >>= 1;
		mat = mat * mat;
	}
	ret = ret * ans;
	for ( int i = 1; i <= n; ++ i ) printf( "%d\n", ret.matrix[ 1 ][ i ] );
	return 0;
}
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0, length = n; i < length; i++)
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ep emplace
#define epb emplace_back
#define scll static_cast<long long> 
#define sz(x) static_cast<int>((x).size())
#define pfll(x) printf("%lld\n", x)
#define ci(x) cin >> x
#define ci2(x, y) cin >> x >> y
#define ci3(x, y, z) cin >> x >> y >> z
#define ci4(w, x, y, z) cin >> w >> x >> y >> z
#define co(x) cout << x << endl
#define co2(x, y) cout << x << " " << y << endl
#define co3(x, y, z) cout << x << " " << y << " " << z << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> PQ;
typedef priority_queue<int, vector<int>, greater<int>> PQG;
typedef priority_queue<P> PQP;
typedef priority_queue<P, vector<P>, greater<P>> PQPG;

const int MAX_N = 2e5, MOD = 1e9 + 7, INF = 1e9;
int n, m, k;
vector<int> to[100];
typedef vector<int> vec;
typedef vector<vec> mat;

int po(int x, int y) {
    int ans = 1;
    while (y > 0) {
        if (y & 1) ans = static_cast<long>(ans) * x % MOD;
        x = static_cast<long>(x) * x % MOD;
        y >>= 1;
    }
    return ans;
}

mat mul(mat &A, mat &B) {
    mat C(A.size(), vec(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] + scll(A[i][k]) * B[k][j] % MOD) % MOD;
            }
        }
    }
    return C;
}

mat pow(mat A, long n) {
    mat B(A.size(), vec(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 >>= 1;
    }
    return B;
}

int main() {
    ci3(n, m, k);
    mat a(n, vec(1));
    rep(i, n) ci(a[i][0]);
    rep(i, m) {
        int x, y;
        ci2(x, y);
        to[x - 1].epb(y - 1);
        to[y - 1].epb(x - 1);
    }
    mat PRO(n, vec(n));
    rep(i, n) {
        rep(j, n) PRO[i][j] = 0;
        for (auto &j: to[i]) PRO[i][j] = 1;
        PRO[i][i] = (2 * m - to[i].size()) % MOD;
    }
    mat POPRO = pow(PRO, k);
    mat ans = mul(POPRO, a);
    int pp = po(po(2 * m, MOD - 2), k);
    rep(i, n) co(scll(ans[i][0]) * pp % MOD);
    return 0;
}
