/*
the vast starry sky,
bright for those who chase the light.
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mk make_pair
const int inf=(int)1e9;
const ll INF=(ll)5e18;
const int MOD=1e9+7;
int _abs(int x){return x<0 ? -x : x;}
int add(int x,int y){x+=y; return x>=MOD ? x-MOD : x;}
int sub(int x,int y){x-=y; return x<0 ? x+MOD : x;}
#define mul(x,y) (ll)(x)*(y)%MOD
void Add(int &x,int y){x+=y; if(x>=MOD) x-=MOD;}
void Sub(int &x,int y){x-=y; if(x<0) x+=MOD;}
void Mul(int &x,int y){x=mul(x,y);}
int qpow(int x,int y){int ret=1; while(y){if(y&1) ret=mul(ret,x); x=mul(x,x); y>>=1;} return ret;}
void checkmin(int &x,int y){if(x>y) x=y;}
void checkmax(int &x,int y){if(x<y) x=y;}
void checkmin(ll &x,ll y){if(x>y) x=y;}
void checkmax(ll &x,ll y){if(x<y) x=y;}
#define out(x) cerr<<#x<<'='<<x<<' '
#define outln(x) cerr<<#x<<'='<<x<<endl
#define sz(x) (int)(x).size()
inline int read(){
    int x=0,f=1; char c=getchar();
    while(c>'9'||c<'0'){if(c=='-') f=-1; c=getchar();}
    while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
    return x*f;
}
const int N=105;
struct matrix{
    int a[N][N],n,m;
    matrix(){memset(a,0,sizeof(a));}
    matrix(int n,int m):n(n),m(m){memset(a,0,sizeof(a));}
    void init(){
        for(int i=1;i<=n;i++) a[i][i]=1; 
    }
};
matrix operator * (matrix A,matrix B){
    matrix ret(A.n,B.m);
    for(int i=1;i<=A.n;i++){
        for(int k=1;k<=A.m;k++){
            for(int j=1;j<=B.m;j++) 
                Add(ret.a[i][j],mul(A.a[i][k],B.a[k][j]));
        }
    }
    return ret;
}
matrix qpow(matrix A,int y){
    matrix ret(A.n,A.n); ret.init();
    while(y){
        if(y&1) ret=ret*A;
        A=A*A;
        y>>=1;
    }
    return ret;
}

int inv[N*N];
int n,m,k,a[N];
struct Edge{int x,y;}E[N*N];
vector<int> v[N];
matrix ans,trans;
void init(){
    n=read(); m=read(); k=read();
    inv[1]=1; for(int i=2;i<=10000;i++) inv[i]=mul(MOD-MOD/i,inv[MOD%i]);
    ans.n=1; ans.m=n; trans.n=n; trans.m=n;
    for(int i=1;i<=n;i++) ans.a[1][i]=read();
    for(int i=1;i<=n;i++) trans.a[i][i]=1;
    for(int i=1;i<=m;i++){
        int x=read(),y=read();
        Sub(trans.a[x][x],inv[m]);
        Add(trans.a[x][x],mul(inv[m],inv[2]));
        Add(trans.a[y][x],mul(inv[m],inv[2]));
        Sub(trans.a[y][y],inv[m]);
        Add(trans.a[y][y],mul(inv[m],inv[2]));
        Add(trans.a[x][y],mul(inv[m],inv[2]));
    }
}
void solve(){
    trans=qpow(trans,k);
    ans=ans*trans;
    for(int i=1;i<=n;i++) printf("%d\n",ans.a[1][i]);
}

int main()
{
    init(); solve();
    return 0;
}
#include <bits/stdc++.h>
 
using namespace std;
using i128 = __int128_t;
using u128 = __uint128_t;
using u64 = uint64_t;

//define
#define int long long
#define ll int
#define trav(i,v)   for(auto i: v)
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()
#define itn int 
#define sz(x) (int)x.size()
    
//typedef
typedef unsigned long long ull;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< std::vector<int> > vvi;
typedef std::vector< std::pair < pii, int > > vpp;
 
const long long MOD = 1000000007;
// const long long MOD = 998244353;
const long double PI = 3.141592653589793238;
const long long pi = 31415926;
const long long inf = 1000000000000000000;
const long long small_inf = INT_MAX;
 
int modpow(int x, int n, int mod = MOD){ int res=1; while(n>0){ if(n&1) res=res*x%mod; x=x*x%MOD; n>>=1;} return res;}
int power(int x, int n){ int res=1; while(n>0){ if(n&1) res=res*x; x=x*x; n>>=1; } return res;}

int n, m, k;

vvi matmul(vvi &res, vvi &mat){
    // repu(i,1,n){
    //     repu(j,1,n){
    //         cout<<mat[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    vvi res1(n+1,vi(n+1,0));
    repu(i,1,n){
        repu(j,1,n){
            repu(k,1,n){
                res1[i][j] += res[i][k]*mat[k][j];
                res1[i][j] %= MOD;
            }
        }
    }
    // repu(i,1,n){
    //     repu(j,1,n){
    //         cout<<res1[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    return res1;
}

vvi matpow(vvi mat, int k){ 
    vvi res(n+1,vi(n+1,0));
    repu(i,1,n)
        res[i][i] = 1; 
    while(k>0){ 
        if(k&1) 
            res=matmul(res,mat); 
        mat=matmul(mat,mat); 
        k>>=1; 
    } 
    return res;
}

void init(){

}

void solve()
{
/*Don't hurry, nothing good comes if you rush*/
    cin>>n>>m>>k;
    vi a(n+1,0);
    repu(i,1,n){
        cin>>a[i];
    }
    vi v[n+1];
    repu(i,1,m){
        int x, y;
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    vi num(n+1,0), den(n+1,1);
    vvi mat(n+1,vi(n+1,0));
    repu(i,1,n){
        mat[i][i] = 2*m-sz(v[i]);
        trav(y,v[i]){
            mat[i][y] = 1;
        }
    }
    repu(i,1,n){
        repu(j,1,n){
            // cout<<mat[i][j]<<" ";
            mat[i][j] *= modpow(2*m,MOD-2);
            mat[i][j] %= MOD;
        }
        // cout<<endl;
    }

    mat = matpow(mat,k);

    vi ans(n+1,0);
    repu(i,1,n){
        repu(j,1,n){
            ans[i] += a[j]*mat[i][j];
            ans[i]%=MOD;
        }
    }
    repu(i,1,n){
        cout<<ans[i]<<endl;
    }
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t23 = 1, tt23 = 1; 
    // cin>>t23;
    init();
    while(tt23<=t23)
    {
        // cout<<"Case #"<<tt23<<": ";
        solve();
        tt23++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}   