#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll P=1000000007;

ll pow(ll x,ll n){
    if(n==1)return x;
    ll half=pow(x,n/2),ret=half*half%P;
    if(n%2)ret=ret*x%P;
    return ret;
}

ll inv(ll x){
    return pow(x,P-2);
}

vector<vector<ll>> matmul(const vector<vector<ll>> &a,const vector<vector<ll>> &b){
    int n=a.size(),p=a[0].size(),m=b[0].size();
    vector<vector<ll>> c(n,vector<ll>(m,0));
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            for(int k=0;k<p;k++)
                c[i][j]=(c[i][j]+a[i][k]*b[k][j])%P;
    return c;
}

vector<vector<ll>> matpow(const vector<vector<ll>> &a,int n){
    if(n==1)return a;
    if(n==2)return matmul(a,a);
    if(n==3)return matmul(matmul(a,a),a);
    vector<vector<ll>> half=matpow(a,n/2),ret=matmul(half,half);
    if(n%2)ret=matmul(ret,a);
    return ret;
}

int main() {
    int n,m,k;
    cin>>n>>m>>k;
    ll inv2m=inv(m)*inv(2)%P;
    vector<ll> a(n);
    for(ll &x:a)
        cin>>x;
    if(k==0){
        for(ll x:a)cout<<x<<endl;
        return 0;
    }
    vector<vector<ll>> mat(n,vector<ll>(n,0));
    for(int i=0;i<n;i++)
        mat[i][i]=1;
    for(int i=0;i<m;i++){
        int u,v;
        cin>>u>>v;
        u--;
        v--;
        mat[u][u]=(mat[u][u]-inv2m+P)%P;
        mat[u][v]=(mat[u][v]+inv2m)%P;
        mat[v][u]=(mat[v][u]+inv2m)%P;
        mat[v][v]=(mat[v][v]-inv2m+P)%P;
    }
    mat=matpow(mat,k);
    for(int i=0;i<n;i++){
        ll ans=0;
        for(int j=0;j<n;j++)
            ans=(ans+mat[i][j]*a[j])%P;
        cout<<ans<<endl;
    }
}
//
//  mod.cpp
//  
//
//  Created by Sagar Singh on 17/12/20.
//

#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#define bug1( x )                   { cerr << (#x) <<"="<< x << endl; }
#define bug2( x , y )               { cerr << (#x) <<"="<< (x) << "    " << (#y) << "="<< (y) << endl; }
#define bug3( x , y , z )           { cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << endl; }
#define bug4( x , y , z , w)        { cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << endl; }
#define bug5( x , y , z , w ,p)     { cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << endl; }
#define bug6( x , y , z , w ,p , q) { cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << "    " << (#q) <<"="<< q << endl; }
#define bugn( x , n )               { cerr<<(#x)<<":";for(int i=0;i<n;i++)cout<<(#x)<<"["<<i<<"]:"<< x[i] << "    "; cout<<endl; }
#define bugnm( x , n , m )          { cerr<<(#x)<<endl;for(int i=0;i<n;i++){ cout<<"Row #"<<i<<":"; for(int j=0;j<m;j++) cout<<x[i][j]<<"     "; cout << endl;} }
typedef unsigned long long ul;
typedef long double ld;
typedef long long ll;
using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;

const int mod = 1e9+7;
int add(int x,int y){
    int z = x + y;
    if( z >= mod ){
        z -= mod;
    }
    return z;
}
int sub(int x,int y){
    int z = x - y;
    if( z < 0 ){
        z += mod;
    }
    return z;
}
int mul(int x,int y){
    ll z = 1ll * x * y;
    if( z >= mod ){
        z %= mod;
    }
    return z;
}
int binpow(int a,ll p){
    int r = 1;
    while( p ){
        if( p & 1 )
            r = mul(r,a);
        a = mul(a,a), p >>= 1;
    }
    return r;
}
int n, m, k;
vvi mul(vvi a, vvi b){
    vvi c(n,vi(n));
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            for(int k=0;k<n;++k){
                c[i][j] = add(c[i][j],mul(a[i][k],b[k][j]));
            }
        }
    }
    return c;
}
vvi binpow(vvi a,int p){
    vvi r(n,vi(n));
    for(int i=0;i<n;++i){
        r[i][i] = 1;
    }
    while( p ){
        if( p & 1 )
            r = mul(r,a);
        a = mul(a,a), p >>= 1;
    }
    return r;
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> m >> k;
    vvi w(n,vi(n));
    vi a(n);
    for(int i=0;i<n;++i){
        cin >> a[i];
    }
    for(int i=0;i<m;++i){
        int u, v; cin >> u >> v;
        w[u-1][v-1] += 1;
        w[v-1][u-1] += 1;
    }
    for(int i=0;i<n;++i){
        int k = 0;
        for(int j=0;j<n;++j){
            k += w[i][j];
        }
        w[i][i] += 2*m - k;
    }
    w = binpow(w,k);
    for(int j=0;j<n;++j){
        int tmp = 0;
        for(int i=0;i<n;++i){
            tmp = add(tmp,mul(a[i],w[i][j]));
        }
        tmp = mul(tmp,binpow(mul(binpow(2,k),binpow(m,k)),mod-2));
        cout << tmp <<   endl;
    }
    
}

