//int max = 2 147 483 647 (2^31-1)
//ll max = 9 223 372 036 854 775 807 (2^63-1)
#include<bits/stdc++.h>
using namespace std;

#define forn(i,n) for(int i=0;i<n;i++)
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pi;

//Fast input and output
void fast_io(){
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);}

//Printing pairs and vectors
template<typename A, typename B> ostream& operator<< (ostream &cout, pair<A,B> const &p) {return cout << "(" << p.f << ", " << p.s << ")";}
template<typename A> ostream& operator<< (ostream &cout, vector<A> const&v){
cout << "["; forn(i,(int)v.size()){ if (i) cout << ", "; cout << v[i];} return cout << "]";}

ll mpow(ll base, ll exp) {
  ll res = 1;
  while (exp) {
    if (exp % 2 == 1){
        res = (res * base) % MOD;
    }
    exp >>= 1;
    base = (base * base) % MOD;
  }
  return res;
}

ll minv(ll base) {
    return mpow(base, MOD - 2);
}

int main(){
  fast_io();
  int n,m,k; cin >> n >> m >> k;
  vi a(n);
  forn(i,n) cin >> a[i];
  vi bina;
  ll b=k;
  while(k>0){
    bina.pb(k%2); k>>=1;}
  int p=bina.size();
  for(int i=0;i<p/2;i++) swap(bina[i],bina[p-1-i]);
  vector<vl>one(n,vl(n));
  forn(i,n) one[i][i]=2*m;
  forn(i,m){
    int x,y; cin >> x >> y;
    one[x-1][x-1]--;
    one[y-1][y-1]--;
    one[x-1][y-1]++;
    one[y-1][x-1]++;
  }
  vector<vl>dp(n,vl(n));
  forn(i,n) dp[i][i]=1;
  forn(l,p){
    vector<vl>newdp(n,vl(n));
    forn(i,n){
      forn(j,n){
        forn(t,n){
          newdp[i][t]=(newdp[i][t]+dp[i][j]*dp[j][t])%MOD;
        }
      }
    }
    dp=newdp; newdp=vector<vl>(n,vl(n));
    if(bina[l]){
      forn(i,n){
        forn(j,n){
          forn(t,n){
            newdp[i][t]=(newdp[i][t]+one[i][j]*dp[j][t])%MOD;
          }
        }
      }
      dp=newdp;
    }
  }
  vl ans(n);
  forn(i,n){
    forn(j,n){
      ans[i]=(ans[i]+dp[i][j]*a[j])%MOD;
    }
    ans[i]=(ans[i]*minv(mpow(2*m,b)))%MOD;
  }
  forn(i,n) cout << ans[i] << "\n";
}
//code by DanTheMan

// KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(int i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(),a.end()
#define sz(x) (int)x.size()
#define szs(x) (int)x.length()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define eq equal_range
#define fs first
#define ss second
#define ins insert
#define mkp make_pair
#define endl "\n"
using namespace std;
typedef vector<ll> vll;
typedef vector<int> vin;
typedef vector<char> vch;
typedef vector<string> vst;
typedef set<ll> sll;
typedef set<int> sint;
typedef set<char> sch;
typedef set<string> sst;
typedef queue<ll> qll;
typedef queue<int> qin;
typedef deque<ll> dqll;
typedef deque<int> dqint;
typedef priority_queue<ll> pqll;
typedef priority_queue<int> pqin;
typedef map<ll,ll> mpll;
typedef map<int,int> mpin;
typedef pair<ll,ll> pll;
typedef pair<int,int> pin;
const ll MOD=1000000007;
const long double PI=3.1415926535897932384626433832795;
ll pwr(ll b,ll p){ll res=1;while(p){if(p&1) {res*=b; p--;}else{b*=b; p>>=1;}}return res;}
ll mpwr(ll b,ll p){ll res=1;while(p){if(p&1) {res=(res*b)%MOD; p--;}else{b=(b*b)%MOD; p>>=1;}}return res;}
int msb (int n) {return 31-__builtin_clz(n);}
ll msbl (ll n) {return 63-__builtin_clzll(n);}
int lsb (int n) {return __builtin_ctz(n);}
ll  lsbl (ll n) {return __builtin_ctzll(n);}
int setbit (int n) {return __builtin_popcount(n);}
ll setbitl (ll n) {return __builtin_popcountll(n);}
int main()
{
/*
freopen ("input.txt","r","stdin");
freopen ("output.txt","w","stdout");
*/
ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL);
vin a (3);
cin>>a[0]>>a[1]>>a[2];
cout<< (2*a[2]==a[1]+a[0] || 2*a[1]==a[0]+a[2] || 2*a[0]==a[1]+a[2]?"Yes":"No");
return 0;
}
/* What we know is a drop , but what we don't know is an ocean !*/