#include<bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<double,double> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const ll mod=1e9 + 7;
const ll LINF=1ll<<60;
const int INF=1<<28;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};



typedef vector<vector<ll>> mat;

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

mat pow(mat A,ll n){
    mat B(A.size(),vector<ll> (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;
}


ll fpow(ll a, ll n){
    ll x = 1;
    if(a == 0) return 1;
    while(n > 0){
        if(n&1){
            x=x*a%mod;
        }
        a=a*a%mod;
        n >>= 1;
    }
    return x;
}
 
int main(){
    ll n,m,k;cin >> n >> m >> k;
    mat a(n, vector<ll> (1));
    for (int i = 0; i < n; i++) {
        cin >> a[i][0];
    }
    if(m == 0){
        for (int i = 0; i < n; i++) {
            cout << a[i][0] << endl;
        }
        return 0;
    }
    mat h(n, vector<ll> (n, 0));
    for (int i = 0; i < m; i++) {
        int x,y;cin >> x >> y;
        x--,y--;
        h[x][y]++;
        h[x][x]++;
        h[y][x]++;
        h[y][y]++;
        for (int j = 0; j < n; j++) {
            if(x == j || y == j) continue;
            h[j][j]+=2;
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            //cout << h[i][j] << " ";
            h[i][j] = h[i][j] * fpow(2, mod - 2) % mod * fpow(m, mod - 2) %mod;
        }
        //cout << endl;
    }
    auto res = mul(pow(h, k), a);
    for (int i = 0; i < n; i++) {
        cout << res[i][0] << endl;
        //cout << res[i][0] * fpow(fpow(2, k), mod - 2) %mod << endl;
    }
    return 0;
}

#include <bits/stdc++.h>

#define rep(i,n) for(LL i=0;i<n;++i)
#define repn(i,n) for(LL i=1;i<=n;++i)
#define LL long long
#define pii pair <LL,LL>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

LL qpow(LL x,LL a)
{
	LL res=x,ret=1;
	while(a>0)
	{
		if((a&1LL)==1LL) ret=ret*res%MOD;
		a>>=1LL;
		res=res*res%MOD;
	}
	return ret;
}

LL n,m,t,a[110];
vector <LL> g[110];
vector <vector <LL> > pw[40],res,tmpp,mulv;
vector <LL> tmp;

vector <vector <LL> > mul(vector <vector <LL> > a,vector <vector <LL> > b)
{
	vector <vector <LL> > ret(a.size(),vector <LL>(b[0].size()));
	rep(i,a.size()) rep(j,b[0].size()) rep(k,b.size()) ret[i][j]=(ret[i][j]+a[i][k]*b[k][j]%MOD)%MOD;
	return ret;
}

void getpow()
{
	repn(i,30) pw[i]=mul(pw[i-1],pw[i-1]);
}

int main()
{
  cin>>n>>m>>t;
  repn(i,n) scanf("%lld",&a[i]);
  LL x,y;
  rep(i,m)
  {
    scanf("%lld%lld",&x,&y);
    g[x].pb(y);g[y].pb(x);
  }
  if(t==0)
  {
    repn(i,n) cout<<a[i]<<endl;
    return 0;
  }
  pw[0].clear();
  LL add=1*qpow(m*2,MOD-2);
  repn(i,n)
  {
    tmp.clear();
    repn(j,n) tmp.pb(0);
    tmp[i-1]=(m-g[i].size())*qpow(m,MOD-2)%MOD;
    rep(j,g[i].size())
    {
      tmp[g[i][j]-1]=(tmp[g[i][j]-1]+add)%MOD;
      tmp[i-1]=(tmp[i-1]+add)%MOD;
    }
    pw[0].pb(tmp);
  }
  getpow();
  bool have=false;
  for(LL i=30;i>=0;--i)
  {
    if(t<(1LL<<i)) continue;
    t-=(1LL<<i);
    if(!have) mulv=pw[i];
    else mulv=mul(mulv,pw[i]);
    have=true;
  }
  repn(i,n)
  {
    tmp.clear();
    tmp.pb(a[i]);
    tmpp.pb(tmp);
  }
  res=mul(mulv,tmpp);
  rep(i,n) cout<<res[i][0]<<endl;
	return 0;
}