#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;
}
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

template <typename T>
struct Matrix
{
    using F = function<T(T, T)>;
    
    int n;
    int m;
    
    vector<vector<T>> a;
    
    const F add;
    const F mul;
    
    const T e0;
    const T e1;
    
    Matrix(
        int n,
        int m,
        const F add = [](T a, T b){return (a + b) % MOD;},
        const F mul = [](T a, T b){return a * b % MOD;},
        const T e0 = 0,
        const T e1 = 1
    ) : n(n), m(m), add(add), mul(mul), e0(e0), e1(e1){
        a.resize(n);
        for(int i = 0; i < n; i++) a[i].resize(m);
    }
    
    Matrix(
        int n,
        const F add = [](T a, T b){return (a + b) % MOD;},
        const F mul = [](T a, T b){return a * b % MOD;},
        const T e0 = 0,
        const T e1 = 1
    ) : n(n), m(n), add(add), mul(mul), e0(e0), e1(e1){
        a.resize(n);
        for(int i = 0; i < n; i++) a[i].resize(m);
    }
    
    static Matrix I(
        int n,
        const F add = [](T a, T b){return (a + b) % MOD;},
        const F mul = [](T a, T b){return a * b % MOD;},
        const T e0 = 0,
        const T e1 = 1
    ){
        Matrix res(n, add, mul, e0, e1);
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++) res.a[i][j] = e0;
        }
        for(int i = 0; i < n; i++) res.a[i][i] = e1;
        return res;
    }
    
    Matrix &operator+=(const Matrix &b){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++) a[i][j] = add(a[i][j], b.a[i][j]);
        }
        return *this;
    }
    
    Matrix &operator*=(const Matrix &b){
        vector<vector<T>> c(n, vector<T>(b.m));
        for(int i = 0; i < n; i++){
            for(int j = 0; j < b.m; j++){
                c[i][j] = e0;
                for(int k = 0; k < m; k++){
                    c[i][j] = add(c[i][j], mul(a[i][k], b.a[k][j]));
                }
            }
        }
        a.swap(c);
        return *this;
    }
    
    Matrix &operator^=(int k){
        Matrix b = Matrix::I(n, add, mul, e0, e1);
        while(k){
            if(k % 2) b *= *this;
            *this *= *this;
            k /= 2;
        }
        a.swap(b.a);
        return *this;
    }
    
    Matrix operator+(const Matrix &a){
        return (Matrix(*this) += a);
    }
    
    Matrix operator*(const Matrix &a){
        return (Matrix(*this) *= a);
    }
    
    Matrix operator^(const int k){
        return (Matrix(*this) ^= k);
    }
};

ll modpow(ll x, ll n){
    ll res = 1, r = x;
    while(n){
        if(n & 1) res = res * r % MOD;
        r = r * r % MOD;
        n >>= 1;
    }
    return res;
}

int main()
{
    int n, m;
    ll k;
    cin >> n >> m >> k;
    ll a[102];
    for(int i = 0; i < n; i++) cin >> a[i];
    Matrix<ll> A(n);
    for(int i = 0; i < n; i++) A.a[i][i] = 1;
    ll r = modpow(m * 2, MOD - 2);
    for(int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        x--; y--;
        A.a[x][x] = (A.a[x][x] + MOD - r) % MOD;
        A.a[y][y] = (A.a[y][y] + MOD - r) % MOD;
        A.a[x][y] = (A.a[x][y] + r) % MOD;
        A.a[y][x] = (A.a[y][x] + r) % MOD;
    }
    A ^= k;
    for(int i = 0; i < n; i++){
        ll s = 0;
        for(int j = 0; j < n; j++) s = (s + A.a[i][j] * a[j]) % MOD;
        cout << s << endl;
    }
    cout << endl;
}
