/*************************************************************************
	> File Name: e.cpp
    > Full Path: /Users/zhanghang/Downloads/e.cpp
	> Author: Hang Zhang
	> Created Time: 三  4/28 14:59:02 2021
 ************************************************************************/

#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<stack>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<cmath>
using namespace std;
typedef long long ll;
const int MAXN=105;
const ll mod=1e9+7;
const int inf=0x3f3f3f3f;

struct Matrix
{
	ll ma[MAXN][MAXN];
	int n;
	Matrix(int n):n(n){ //nn is the dimension of matrix
		memset(ma,0,sizeof ma);
	}
};
Matrix mul(Matrix A,Matrix B,long long mod)
{
	int n=A.n;
	Matrix C(n);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<n;k++)
			{
				C.ma[i][j]=(C.ma[i][j]+A.ma[i][k]*B.ma[k][j])%mod;
			}
		}
	}
	return C;
}
Matrix pow_mod(Matrix A,long long k, long long mod)
{
	int n=A.n;
	Matrix B(n);
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			B.ma[i][j]=0;
		}
		B.ma[i][i]=1;
	}
	while(k)
	{
		if(k&1) B=mul(B,A,mod);
		A=mul(A,A,mod);
		k>>=1;
	}
	return B;
}


long long quick_pow(long long a, long long b, long long mod) {
	a %= mod;
	long long res = 1;
	while (b) {
		if (b & 1) res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return res;
}
int a[MAXN];
vector<int>G[MAXN];
int main(){
	int n,m,k;
	cin>>n>>m>>k;
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=1;i<=m;i++){
		int x,y;cin>>x>>y;
		x--;y--;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	ll tmp=quick_pow(m*2LL,1LL*mod-2,mod);
	Matrix t(n);
	for(int i=0;i<n;i++){
		int d=G[i].size();
		t.ma[i][i]=((1LL-tmp*d%mod)%mod+mod)%mod;
		for(auto v:G[i]){
			t.ma[i][v]=tmp;
		}
	}
	Matrix e=pow_mod(t,k,mod);
	for(int i=0;i<n;i++){
		ll ans=0;
		for(int j=0;j<n;j++){
			ans+=e.ma[i][j]*a[j];
			ans%=mod;
		}
		cout<<ans<<endl;
	}
	

	return 0;
}

#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long
#define f(a,b) for(int i=a; i<b; i++)
#define rep(i,a,b) for(int i=a;i< b;i++)
#define endl "\n"
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define fr first
#define sc second
#define INF 1000000000
#define pb push_back
#define ppb pop_back()
#define sz(x) (int)((x).size())
#define vi vector<int> 
#define vvi vector<vector<int>>
#define PI 3.14159265358979323846
using namespace std;
const int N=100+5;
int d[N];
const long long MOD2 = static_cast<long long>(MOD) * MOD;
 
struct Matrix
{
  vector< vector<int> > mat;
  int n_rows, n_cols;
 
  Matrix() {}
 
  Matrix(vector< vector<int> > values): mat(values), n_rows(values.size()),
    n_cols(values[0].size()) {}
 
  static Matrix identity_matrix(int n)
  {
    vector< vector<int> > values(n, vector<int>(n, 0));
    for(int i = 0; i < n; i++)
      values[i][i] = 1;
    return values;
  }
 
  Matrix operator*(const Matrix &other) const 
  {
    int n = n_rows, m = other.n_cols;
    vector< vector<int> > result(n_rows, vector<int>(n_cols, 0));
    for(int i = 0; i < n; i++)
      for(int j = 0; j < m; j++) {
        long long tmp = 0;
        for(int k = 0; k < n_cols; k++) {
          tmp += mat[i][k] * 1ll * other.mat[k][j];
          while(tmp >= MOD2)
            tmp -= MOD2;
        }
        result[i][j] = tmp % MOD;
      }
 
    return move(Matrix(move(result)));
  }
 
  inline bool is_square() const
  {
    return n_rows == n_cols;
  }
};
 
// binary exponentiation, returns a^p
Matrix pw(Matrix a,int p){
  Matrix result = Matrix::identity_matrix(a.n_cols);
  while (p > 0) {
    if (p & 1)
      result = a * result;
    a = a * a;
    p >>= 1;
  }
  return result;
}
int binpow(int a,int b){
  int res=1;
  while(b){
    if(b&1) res*=a , res%=MOD;
    a*=a , a%=MOD;
    b>>=1;
  }
  return res;
}
void test_case()
{
  int n,m,k;
  cin>>n>>m>>k;

  vector<vector<int>> v(n,vector<int>(1));
  vector<vector<int>> mat(n,vector<int>(n,0));
  rep(i,0,n) cin>>v[i][0];
  int oneby2m=binpow(2*m,MOD-2);
  rep(i,0,m){
    int x,y;
    cin>>x>>y;
    x--;y--;
    d[x]++;d[y]++;
    mat[x][y]=mat[y][x]=oneby2m;
  } 
  rep(i,0,n){
    mat[i][i]=(2*m-d[i]) * oneby2m %MOD;
  }
  Matrix ans=pw(mat,k)*v;
  rep(i,0,n) cout<< ans.mat[i][0] << endl ;
  
}
signed main()
{
  fast_io;
  #ifdef NCR
    init();
  #endif
  int t=1;
  // cin>>t;
  rep(i,0,t){
  //cout<< "Case #" << i+1 << ": ";
         test_case();
  }
  return 0;
}
//taskkill -im main.exe -f