/*
    atcoder —— abc199 —— F-Graph Smoothing
*/
#include <bits/stdc++.h>

using namespace std;

#define closeSync ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const ll MOD = 1e9+7;
const int MAXN = 105;

int n,m,k;
ll A[MAXN],B[MAXN],down = 1;
ll mp[MAXN][MAXN];
struct Mat{
    ll a[MAXN][MAXN];
    int n;
    Mat(int _n = 0)
    {
        n = _n;
        for (int i=1;i<=n;i++) 
            for (int j=1;j<=n;j++)
                a[i][j] = 0;
    }
    Mat operator*(const Mat& x)const
    {
        Mat res(n);
        for (int i=1;i<=n;i++)
            for (int j=1;j<=n;j++)
                for (int k=1;k<=n;k++)
                    res.a[i][j] += a[i][k]*x.a[k][j],res.a[i][j] %= MOD;  
        return res;
    }
    void ones()
    {
        for (int i=1;i<=n;i++)  a[i][i] = 1;
    }
};

inline Mat mpower(Mat x,ll p)
{
    Mat res(n); 
    res.ones();
    while (p)
    {
        if (p&1) res = res * x;
        p >>= 1;
        x = x * x;
    }
    return  res;
}

inline ll qpower(ll x,ll p,ll mod)
{
    ll res = 1;
    while (p)
    {
        if (p&1) res *= x,res %= mod;
        p >>= 1;
        x *= x;
        x %= mod;
    }
    return res;
}

inline void solve()
{
    cin >> n >> m >> k;
    Mat help(n);
    for (int i=1;i<=n;i++)  cin >> A[i];
    for (int i=1;i<=m;i++)  
    {
        int u,v;    cin >> u >> v;
        mp[u][v] = mp[v][u] = 1;
    }
    for (int i=1;i<=n;i++)
    {
        int cnt = 0;
        for (int j=1;j<=n;j++)
            if (mp[i][j])  cnt++,help.a[i][j]++,help.a[i][i]++;
        help.a[i][i] += ((m-cnt) << 1);
    }

    Mat tmp = mpower(help,k);

    for (int i=1;i<=n;i++)
        for (int j=1;j<=n;j++)
            B[i] += tmp.a[i][j] * A[j],B[i] %= MOD; 

    down *= (qpower(2LL,k,MOD) * qpower(m,k,MOD) % MOD);
    down %= MOD;
    for (int i=1;i<=n;i++)
        cout << (B[i] * qpower(down,MOD-2,MOD) % MOD) << "\n";
}

int main()
{closeSync;  
    // int T;
    // cin >> T;
    // while (T--)
        solve();
    return 0;
}

/*
3 2 2
12 48 36
1 2
1 3

750000036   
36          
250000031
*/
#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

using mat = vector<vector<ll>>;

ll N, M, K;
bool G[110][110];
mat A, E;

ll powmodp(ll x, ll n) {
    if (n==0) return 1;
    if (n%2) return x * powmodp(x,n-1) % mod;
    ll res = powmodp(x,n/2);
    return res * res % mod;
}

ll inv(ll x) {return powmodp(x,mod-2);}

mat prod(mat x, mat y) {
    ll n = x.size();
    mat res(n,vector<ll>(N));
    rep(i,n) rep(j,N) rep(k,N) {
        res[i][j] += x[i][k]*y[k][j]%mod;
        res[i][j] %= mod;
    }
    return res;
}

mat powmat(mat x, ll n) {
    if (n==0) return E;
    if (n%2) return prod(x,powmat(x,n-1));
    mat res = powmat(x,n/2);
    return prod(res,res);
}

int main() {
    cin >> N >> M >> K;
    A.resize(1,vector<ll>(N));
    rep(i,N) cin >> A[0][i];
    rep(i,M) {
        ll x, y; cin >> x >> y;
        x--; y--;
        G[x][y] = G[y][x] = true;
    }
    E.resize(N,vector<ll>(N));
    rep(i,N) E[i][i] = 1LL;

    ll p = inv(M);
    ll half = inv(2);

    mat f(N,vector<ll>(N));
    rep(j,N) {
        ll cnt = 0;
        rep(i,N) if (G[i][j]) cnt++;
        rep(i,N) {
            if (i==j) {
                ll q = cnt * p % mod;
                ll sub = q * half % mod;
                f[i][j] = (1 + mod - sub) % mod;
            } else if (G[i][j]) {
                f[i][j] = p * half % mod;
            }
        }
    }

    mat F = powmat(f,K);
    mat vec = prod(A,F);

    vector<ll> res = vec[0];
    for (ll ans : res) cout << ans << endl;
}