#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define reps(i,s,n) for(int i=s; i<n; i++)
#define per(i,n) for(int i=n-1; i>=0; i--)
#define pers(i,n,s) for(int i=n-1; i>=s; i--)
#define all(v) v.begin(),v.end()
#define fi first
#define se second
#define pb push_back
#define si(v) int(v.size())
#define lb(v,n) lower_bound(all(v),n)
#define lbi(v,n) int(lower_bound(all(v),n) - v.begin())
#define ub(v,n) upper_bound(all(v),n)
#define ubi(v,n) int(upper_bound(all(v),n) - v.begin())
 
#define mod 1000000007
#define infi 1010000000
#define infl 1100000000000000000
 
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define IN(n,m,v) rep(i,n) rep(j,m){cin >> v[i][j];}
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define cYES cout << "YES" << endl
#define cNO cout << "NO" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
 
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;
template<typename T> bool chmax(T &a, T b) {if(a < b) {a = b;return 1;}return 0;}
template<typename T> bool chmin(T &a, T b) {if(a > b) {a = b;return 1;}return 0;}


template <typename T> T extgcd(T a, T b, T& x, T& y){
    T d = a;
    if(b != 0){
        d = extgcd(b,a%b,y,x);
        y-=(a/b)*x;
    }
    else x=1,y=0;
    return d;
}

template <typename T> T mod_pow(T m, T n) {
    if(n == 0) return 1;
    T res = mod_pow(m*m%mod, n/2);
    if(n & 1) res *= m;
    return res%mod;
}

template <typename T> T mod_inv(T n) {
    T m = mod;
    T x,y;
    extgcd(n,m,x,y);
    return (m+x%m)%m;
}


void solve(){
    
    int N,M,K;
    cin >> N >> M >> K;
    vl A(N);
    in(N,A);
    
    vvl P(N,vl(N,0));
    rep(i,N) P[i][i] = 1;
    ll mm = mod_inv<ll>((ll)(M*2));
    rep(i,M){
        int x,y;
        cin >> x >> y;
        x--,y--;
        P[x][x] += mod;
        P[y][y] += mod;
        (P[x][x] -= mm) %= mod;
        (P[x][y] += mm) %= mod;
        (P[y][x] += mm) %= mod;
        (P[y][y] -= mm) %= mod;
    }
    
    ve<vvl> vP;
    vP.pb(P);
    rep(i,30){
        vvl p = vP.back();
        vvl pp(N,vl(N,0));
        rep(i,N) rep(j,N) rep(k,N) (pp[i][j] += p[i][k]*p[k][j]%mod) %= mod;
        vP.pb(pp);
    }
    
    vl ans = A;
    int id = 0;
    while (K > 0) {
        if(K & 1){
            A = ans;
            ans.assign(N,0);
            rep(i,N) rep(j,N) (ans[i] += vP[id][i][j]*A[j]%mod) %= mod;
        }
        id++;
        K = K >> 1;
    }
    
    rep(i,N) cout << ans[i] << endl;
    
    
    
}



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

    solve();

    return 0;
}

#include <iostream>

using namespace std;
using LL = long long;

const int kMaxN = 101;
const LL kMod = 1e9 + 7;

int n, m, k;
LL d[kMaxN], a[kMaxN], r[kMaxN][kMaxN], p_n = 1, b[kMaxN][kMaxN], c[kMaxN][kMaxN];
bool l[kMaxN][kMaxN];

LL PM(LL x) {
  LL s = 1;
  for (LL i = kMod, b = x; i; i >>= 1, b = b * b % kMod) {
    if (i & 1) {
      s = s * b % kMod;
    }
  }
  return s;
}

void M(LL a[kMaxN][kMaxN], LL b[kMaxN][kMaxN]) {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      c[i][j] = 0;
      for (int k = 1; k <= n; ++k) {
        c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % kMod;
      }
    }
  }
}

int main() {
  cin >> n >> m >> k;
  for (LL i = kMod - 2, b = 2 * m; i; i >>= 1, b = b * b % kMod) {
    if (i & 1) {
      p_n = p_n * b % kMod;
    }
  }
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1, x, y; i <= m; ++i) {
    cin >> x >> y;
    l[x][y] = l[y][x] = 1;
    ++d[x], ++d[y];
  }
  for (int i = 1; i <= n; ++i) {
    b[i][i] = 1;
    for (int j = 1; j <= n; ++j) {
      if (i == j) {
        r[i][j] = (2 * m - d[i]) * p_n % kMod;
      } else if (l[i][j]) {
        r[i][j] = p_n;
      }
    }
  }
  for (int i = k; i; i >>= 1) {
    if (i & 1) {
      M(r, b);
      copy(&c[1][1], &c[n][n] + 1, &b[1][1]);
    }
    M(r, r);
    copy(&c[1][1], &c[n][n] + 1, &r[1][1]);
  }
  for (int i = 1; i <= n; ++i) {
    LL s = 0;
    for (int j = 1; j <= n; ++j) {
      s = (s + a[j] * b[j][i]) % kMod;
    }
    cout << s << endl;
  }
  return 0;
}
