#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <cassert>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

using namespace std;

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}
template <class Con>
string concat(const Con &c, const string &spr){
	stringstream ss;
	typename Con::const_iterator it = c.begin(), en = c.end();
	bool fst = true;
	for(; it != en; ++it){
		if(!fst){ ss << spr; }
		fst = false;
		ss << *it;
	}
	return ss.str();
}

template <class Con, class Fun>
vector<typename Con::value_type> cfilter(const Con &c, Fun f) {
	vector<typename Con::value_type> ret;
	typename Con::const_iterator it = c.begin(), en = c.end();
	for(; it != en; ++it){
		if(f(*it)){
			ret.emplace_back(*it);
		}
	}
	return ret;
}
#if __cplusplus >= 201103L
template <class Con, class Fun>
auto cmap(const Con &c, Fun f) -> vector<decltype(f(*c.begin()))> {
	vector<decltype(f(*c.begin()))> ret;
	ret.reserve(c.size());
	for(const auto &x: c){
		ret.emplace_back(f(x));
	}
	return ret;
}
#endif

#if __cplusplus >= 201402L
#define lambda(e) ([&](const auto &_){ return (e); })
#define lambda2(e) ([&](const auto &_a, const auto &_b){ return (e); })
#endif


#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()
#define tget(t,i) get<i>(t)

#define MOD 1000000007LL
#define EPS 1e-8

LL inv(LL x){
	LL y = MOD - 2;
	LL a = 1;
	while(y){
		if(y & 1){ a = a * x % MOD; }
		x = x * x % MOD;
		y >>= 1;
	}
	return a;
}

vvll mul(const vvll &a, const vvll &b){
	int n = a.size();
	vvll c;
	initvv(c, n, n);
	REP(i, n)
	REP(k, n)
	REP(j, n){
		c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % MOD;
	}
	return c;
}

vvll pow(vvll x, LL y){
	int n = x.size();
	vvll a;
	initvv(a, n, n);
	REP(i, n){
		a[i][i] = 1;
	}
	while(y){
		if(y & 1){ a = mul(a, x); }
		x = mul(x, x);
		y >>= 1;
	}
	return a;
}

void mainmain(){
	int n, m, q;
	cin >> n >> m >> q;
	vll as(n);
	for(LL &a : as){ cin >> a; }
	VV(int) G(n);
	REP(i, m){
		int x, y;
		cin >> x >> y;
		--x;
		--y;
		G[x].push_back(y);
		G[y].push_back(x);
	}

	LL im = inv(m);
	LL i2m = inv(2 * m);
	vvll b;
	initvv(b, n, n);
	REP(u, n){
		b[u][u] = (m - G[u].size()) * im;
		for(int v : G[u]){
			b[u][u] += i2m;
			b[u][v] += i2m;
		}
	}
	for(auto &v : b){
		for(LL &x : v){ x %= MOD; }
	}

	vvll c = pow(b, q);
	REP(i, n){
		LL s = 0;
		REP(j, n){
			s = (s + c[i][j] * as[j]) % MOD;
		}
		cout << s << '\n';
	}
}



}
int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}

#include<bits/stdc++.h>
#define int long long
#define N 100
#define P 1000000007
#define inf 999999999999999999
using namespace std;
int n,m,K,d[N+1],dq[N+1],g[N+1][N+1],ny2,ans[N+1],p,q;
int ksm(int x,int y){int nans=1;for(;y;y>>=1,x=x*x%P)if(y&1)nans=nans*x%P;return nans;}
int qny(int x){return ksm(x,P-2);}
struct mat{
	int a[N+1][N+1];
	const mat operator *(mat y)const{
		mat nans;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				nans.a[i][j]=0;
				for(int k=1;k<=n;k++)nans.a[i][j]+=this->a[i][k]*y.a[k][j],nans.a[i][j]%=P;
			}
		}return nans;
	}
}I,A;
void ycl(){
	ny2=qny(2);
	for(int i=1;i<=n;i++)I.a[i][i]=1;
	for(int i=1;i<=n;i++){
		A.a[i][i]=ny2+(m-d[i])*qny(2*m%P)%P;
		for(int j=1;j<=n;j++){
			if(g[i][j])A.a[i][j]=qny(2*m%P);
		}
	}
}
mat ksm(mat x,int y){mat nans=I;for(;y;y>>=1,x=x*x)if(y&1)nans=nans*x;return nans;}
signed main(){
	cin>>n>>m>>K;
	for(int i=1;i<=n;i++)cin>>dq[i];
	for(int i=1;i<=m;i++)cin>>p>>q,g[p][q]=g[q][p]=1,d[p]++,d[q]++;
	ycl();
	A=ksm(A,K);
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)ans[i]+=dq[j]*A.a[i][j],ans[i]%=P;
	for(int i=1;i<=n;i++)printf("%lld\n",ans[i]);
	return 0;
}