#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 matrix = vector<vector<ll>>;

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);}

ll N, M, K;
vector<ll> A, G[110];
ll p, half;

matrix E(ll n) {
    matrix res(n,vector<ll>(n));
    rep(i,n) res[i][i] = 1;
    return res;
}

void addmodp(ll &x, ll y) {x = (x + y) % mod;}

matrix prodmatrix(matrix x, matrix y) {
    ll H = x.size(), W = y[0].size(), sz = y.size();
    matrix res(H,vector<ll>(W));
    rep(i,H) rep(j,W) rep(k,sz) {
        addmodp(res[i][j], x[i][k] * y[k][j] % mod);
    }
    return res;
}
vector<ll> prodmatrix(matrix x, vector<ll> y) {
    matrix z(y.size(),vector<ll>(1));
    rep(i,y.size()) z[i][0] = y[i];
    matrix tmp = prodmatrix(x,z);
    vector<ll> res(tmp.size());
    rep(i,tmp.size()) res[i] = tmp[i][0];
    return res;
}
vector<ll> prodmatrix(vector<ll> x, matrix y) {
    matrix z(1,vector<ll>(x.size()));
    rep(i,x.size()) z[0][i] = x[i];
    matrix tmp = prodmatrix(z,y);
    vector<ll> res(tmp[0].size());
    rep(i,tmp[0].size()) res[i] = tmp[0][i];
    return res;
}

matrix powmodp(matrix x, ll n) {
    if (n==0) return E(x.size());
    if (n%2) return prodmatrix(x,powmodp(x,n-1));
    matrix res = powmodp(x,n/2);
    return prodmatrix(res,res);
}

void init() {
    cin >> N >> M >> K;
    A.resize(N);
    rep(i,N) cin >> A[i];
    rep(i,M) {
        ll x, y; cin >> x >> y;
        x--; y--;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    p = inv(M);
    half = inv(2);
}

int main() {
    init();
    matrix mat(N,vector<ll>(N));
    rep(i,N) {
        ll cnt = G[i].size();
        for (ll j : G[i]) mat[i][j] = p * half % mod;
        ll q = cnt * p % mod;
        q = q * half % mod;
        mat[i][i] = (1 + mod - q) % mod;
    }
    matrix F = powmodp(mat,K);
    
    vector<ll> res = prodmatrix(F,A);
    for (ll ans : res) cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
namespace math{
    const int MOD = 1e9+7;
    const int MN = 10'100;
    int fact[MN], inv_fact[MN];
    int power(int a, int n) {
        int res = 1;
        for (;n; n >>= 1, a = (a * a) % MOD) if (n & 1) res = (res * a) % MOD;
        return res;
    }
    int inv(int a) { return inv_fact[a]*fact[a-1]%MOD; }
    void init_fact() {
        fact[0]=1;
        for (int i=1;i<MN;++i) fact[i] = fact[i-1]*i%MOD;
        inv_fact[MN-1] = power(fact[MN-1], MOD - 2);
        for (int i=MN-1; i>0;--i) inv_fact[i-1]=inv_fact[i]*i%MOD;
    }
    struct mint {
        int n;
        mint(int n): n(n){}
        mint(): n(0){}
        mint operator+(mint o){return (n + o.n) % MOD;}
        mint operator-(mint o){return (n - o.n % MOD + MOD) % MOD;}
        mint operator*(mint o){return (n * o.n) % MOD;}
        mint operator/(mint o){return o.n >= MN ? n * power(o.n, MOD - 2) % MOD : n * inv(o.n) % MOD;}
    };
};
using namespace math;
using mat = vector<vector<mint>>;
int n, m, k;
vector<int> g[100];
mat M;
mat operator*(mat A, mat B)
{
    mat ret(A.size(), vector<mint>(B[0].size()));
    for (int i = 0; i < A.size(); ++i)
    {
        for (int j = 0; j < B[0].size(); ++j)
        {
            for (int k = 0; k < B.size(); ++k)
                ret[i][j] = ret[i][j] + A[i][k] * B[k][j];
        }
    }
    return ret;
}
mat power(mat A, int n)
{
    mat ret(A.size(), vector<mint>(A.size()));
    for (int i = 0;  i < A.size(); ++i)
        ret[i][i] = 1;
    for (; n; A = A * A, n >>= 1)
    {
        if (n & 1) ret = ret * A;
    }
    return ret;
}
signed main()
{
    cin.tie(0)->sync_with_stdio(false);
    cin>>n>>m>>k;
    M.resize(n, vector<mint>(n));
    
    mat A(1, vector<mint>(n));
    for (int i = 0; i< n;++i)
        cin>>A[0][i].n;

    for (int i = 0; i<m;++i)
    {
        int u, v; cin>>u>>v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    init_fact();

    for (int i = 0; i < n;++i)
    {
        M[i][i] = mint(1) - mint(g[i].size()) / m / 2;
        for (int it: g[i])
        {
            M[it][i] = mint(1) / m / 2;

        }
    }

    mat Ans = A * power(M, k);
    for (int i = 0; i<n;++i)
        cout << Ans[0][i].n << '\n';
    return 0;
}