#define taskname "test"

#include <bits/stdc++.h>

using namespace std;

#define sz(x) (int)x.size()
#define fi first
#define se second

typedef long long lli;
typedef pair<int, int> pii;

const int maxn = 105;
const int mod = 1e9 + 7;

int powmod(int x, int k) {
    if(k == 0) return 1;
    int t = powmod(x, k / 2);
    if(k % 2 == 0) return t * 1LL * t % mod;
    else return t * 1LL * t % mod * x % mod;
}

int inv(int x) {
    return powmod(x, mod - 2);
}

int add(int x, int y) {
    x += y;
    if(x >= mod) x -= mod;
    return x;
}

struct matrix {

    int val[maxn][maxn];

    matrix() {
        fill_n(&val[0][0], sizeof(val) / sizeof(val[0][0]), 0);
    }

    matrix operator *(const matrix&other) const {
        matrix res;
        for(int i = 0; i < maxn; ++i) {
            for(int j = 0; j < maxn; ++j) {
                for(int k = 0; k < maxn; ++k) {
                    res.val[i][j] = add(res.val[i][j], val[i][k] * 1LL * other.val[k][j] % mod);
                }
            }
        }
        return res;
    }
};

matrix mpow(matrix x, int k) {
    if(k == 1) return x;
    matrix t = mpow(x, k / 2);
    if(k % 2 == 0) return t * t;
    else return t * t * x;
}

int n, m, k;
int a[maxn];
vector<int> gr[maxn];

void read_input() {
    cin >> n >> m >> k;
    for(int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    for(int i = 1; i <= m; ++i) {
        int u, v;
        cin >> u >> v;
        gr[u].push_back(v);
        gr[v].push_back(u);
    }
}

void solve() {
    if(k == 0) {
        for(int i = 1; i <= n; ++i) {
            cout << a[i] << '\n';
        }
        return;
    }

    matrix A, B;
    for(int j = 1; j <= n; ++j) {
        A.val[1][j] = a[j];
    }
    for(int j = 1; j <= n; ++j) {
        for(auto&i: gr[j]) {
            B.val[i][j] = inv(m) * 1LL * inv(2) % mod;
        }
        B.val[j][j] = add(inv(m) * 1LL * inv(2) % mod * sz(gr[j]) % mod, (m - sz(gr[j])) * 1LL * inv(m) % mod);
    }

    A = A * mpow(B, k);
    for(int i = 1; i <= n; ++i) {
        cout << A.val[1][i] << '\n';
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    read_input();
    solve();

}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define pb emplace_back
#define lb(v,k) (lower_bound(all(v),(k))-v.begin())
#define ub(v,k) (upper_bound(all(v),(k))-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
#define all(a) a.begin(),a.end()
#define rsort(a) {sort(all(a));reverse(all(a));}
#define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());}
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vvvvi=vector<vvvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001001;
const ll INF=1001001001;
const ll mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void outset(T s){auto itr=s.begin();while(itr!=s.end()){if(itr!=s.begin())cout<<' ';cout<<*itr;itr++;}cout<<'\n';}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){ll res=1;a%=mod;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;}
vi matmul(vi dp,vvi mt,int n){
    vi res(n);
    rep(i,n)rep(j,n)res[i]+=mt[i][j]*dp[j]%mod;
    rep(i,n)res[i]%=mod;
    return res;
}
vvi update(vvi mt,int n){
    vvi res(n,vi(n));
    rep(i,n)rep(j,n)rep(k,n)res[i][j]+=mt[i][k]*mt[k][j]%mod;
    rep(i,n)rep(j,n)res[i][j]%=mod;
    return res;
}
void matpow(vi &dp,vvi mt,ll k,int n){
    while(k){
        if(k&1)dp=matmul(dp,mt,n);
        mt=update(mt,n);
        k>>=1;
    }
}
/*
int main(){
    ll n,k;cin>>n>>k; //nは分かってる項数、kは求めたいのが何項目か
    vi dp(n);
    rep(i,n)cin>>dp[n-i-1];
    if(k<=n)dame(dp[n-k]); //分かっている
    vvi mt(n,vi(n));
    rep(i,n)cin>>mt[0][i]; //遷移の式
    REP(i,1,n)mt[i][i-1]=1; //こうすると上手くいく
    matpow(dp,mt,k-n,n);
    out(dp[0]);
}
*/

//ABC009D 漸化式
int main(){
    ll n,m,k;cin>>n>>m>>k;
    vvi mt(n,vi(n));
    vi dp(n);rep(i,n)cin>>dp[i];
    ll tmp=modpow(m,mod-2);
    ll tmp2=modpow(2,mod-2);
    rep(i,m){
        ll a,b;cin>>a>>b;a--;b--;
        mt[a][b]=tmp2;
        mt[b][a]=tmp2;
    }
    rep(i,n){
        ll sum=0;
        rep(j,n)sum+=mt[i][j];
        mt[i][i]=(m+mod-sum%mod)%mod;
    }
    rep(i,n)rep(j,n)mt[i][j]=mt[i][j]*tmp%mod;
    matpow(dp,mt,k,n);
    for(ll x:dp)out(x);
}