#include <iostream>
#include <vector>
#include <utility>
#include<algorithm>
#include <string>
#include <map>
#include <cmath>
#include <random>
#include <tuple>
#include <set>
#include <queue> 
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod % 1000000007
 
using namespace std;



int main(){
  ll n,m,k;
  cin >> n >> m >> k;
  ll kk = k;
  vector<ll> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<vector<ll>> x(n,vector<ll>(n,0));
  rep(i,n){
    x[i][i] = 2*m;
  }
  rep(i,m){
    ll c,d;
    cin >> c >> d;
    x[c-1][d-1] = 1;
    x[d-1][c-1] = 1;
    x[c-1][c-1] --;
    x[d-1][d-1] --;
  }
  while(k != 0){
    if(k % 2 != 0){
      vector<ll> b(n,0);
      rep(i,n){
        rep(j,n){
          b[i] = (b[i]+a[j]*x[j][i])mod;
        }
      }
      a = b;
    }
    k = k/2;
    vector<vector<ll>> b(n,vector<ll>(n,0));
    rep(i,n){
      rep(j,n){
        rep(h,n){
          b[i][j] = (b[i][j] + x[h][j] * x[i][h])mod;
        }
      }
    }
    x = b;
  }
  ll t = 1;
  ll s = 1;
  ll d = 2*m;
  k = kk;
  while(k != 0){
    if(k % 2 == 1){
      s = (s*d)mod;
    }
    d = (d*d)mod;
    k = k/2;
  }
  ll rem = 1000000005;
  while(rem != 0){
    if(rem % 2 == 1){
      t = (t*s) mod;
    }
    s = (s*s)mod;
    rem = rem/2;
  }
  rep(i,n){
    ll z = (a[i]*t)mod;
    cout << z << endl;
  }
  
  return 0;
}
#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;
}