#include<bits/stdc++.h>
using namespace std;

long long int MOD = 1000000007;

void mult(vector<vector<long long int>> &a, vector<vector<long long int>> &b, int n) {
    vector<vector<long long int>> c(n, vector<long long int>(n, 0));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < n; k++) {
                c[i][j] += a[i][k] * b[k][j];
                c[i][j] %= MOD;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            a[i][j] = c[i][j];
        }
    }
}

void bin_mat(vector<vector<long long int>> &m, long long int e, int n, vector<vector<long long int>> &temp) {
    if (e == 0)
        return;
    if (e == 1)
        return;
    
    bin_mat(m, e / 2, n, temp);
    mult(m, m, n);
    if (e % 2)
        mult(m, temp, n);
}

long long int bin_pow(long long int b, long long int e) {
    if (e == 0) return 1;

    long long int temp = bin_pow(b, e / 2);
    temp = temp * temp % MOD;
    if (e % 2)
        return temp * b % MOD;
    return temp;
}

void solve() {
    int n,m,k; cin >> n >> m >> k;
    vector<long long int> num(n);
    for (int i = 0; i < n; i++) {
        cin >> num[i];
    }
    vector<vector<int>> graph(n);
    for (int i = 0; i < m; i++) {
        int a,b; cin >> a >> b;
        a--; b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    vector<vector<long long int>> mat(n, vector<long long int>(n, 0));

    for (int i = 0; i < n; i++) {
        int cnt = m - graph[i].size();
        mat[i][i] += 2 * cnt % MOD;
        for (auto j: graph[i]) {
            mat[i][i]++;
            mat[i][j]++;
        }
    }
    vector<vector<long long int>> temp = mat;
    bin_mat(mat, k, n, temp);

    if (k > 0) {
        vector<long long int> ans(n, 0);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                ans[i] += mat[i][j] * num[j] % MOD;
                ans[i] %= MOD;
            }
        }

        long long int val = bin_pow(2 * m, k);
        val = bin_pow(val, MOD - 2);
        for (int i = 0; i < n; i++) {
            cout << ans[i] * val % MOD << '\n';
        }
    } else {
        for (int i = 0; i < n; i++)
            cout << num[i] % MOD << '\n';
    }

}

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

    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
    
    return 0;
}
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

ll mod=1e9+7;
mat I;

mat mul(mat a,mat b)
{
	int n=a.size();
	mat c(n,vll(n));
	rep(i,0,n-1)rep(j,0,n-1)rep(k,0,n-1)
	{
		c[i][j]=(c[i][j]+a[i][k]*b[k][j])%mod;
	}
	return c;
}

ll p(ll a,ll b)
{
	ll r=1;
	while(b)
	{
		if(b%2)r=(r*a)%mod;
		a=(a*a)%mod;
		b/=2;
	}
	return r;
}

mat p(mat a,ll b)
{
	mat r=I;
	while(b)
	{
		if(b%2)
		r=mul(r,a);
		a=mul(a,a);
		b/=2;
	}
	return r;
}
ll n,m,k,e[105][105],a[105];

int main()
{ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m>>k;

I.resize(n);
rep(i,0,n-1)
{
	I[i].resize(n);
	I[i][i]=1;
}

rep(i,0,n-1)cin>>a[i];

rep(i,0,m-1)
{
	int x,y;
	cin>>x>>y;
	x--;y--;
	e[x][y]=1;
	e[y][x]=1;
}
mat prod(n,vll(n));

rep(i,0,n-1)
{
	ll ed=0;
	rep(j,0,n-1)ed+=e[i][j];
	prod[i][i]=(2*m-ed)%mod;
	rep(j,0,n-1)if(e[i][j])prod[i][j]=1;
}
prod=p(prod,k);

ll den=p(2*m,k);
den=p(den,mod-2);

rep(i,0,n-1)
{
	ll ans=0;
	rep(j,0,n-1)
	{
		ans=(ans+prod[i][j]*a[j])%mod;
	}
	ans=(ans*den)%mod;
	ol(ans);on;
}
return 0;
}



