#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9+7;
const long long inv = (mod+1)/2;

long long mpow(long long a, long long b){
    if(b==0)return 1;
    if(b==1)return a;
    long long res = mpow(a, b/2);
    res *= res;
    res %= mod;
    if(b&1){
        res *= a;
        res %= mod;
    }
    return res;
}

vector<vector<long long>> mul(vector<vector<long long>>&A, vector<vector<long long>>&B){
    int n = A.size();
    vector<vector<long long>>C(n, vector<long long>(n, 0));
    int i, j, k;
    for(i=0;i<n;i++){
        for(k=0;k<n;k++){
            for(j=0;j<n;j++){
                C[i][j] += A[i][k]*B[k][j] % mod;
                if(C[i][j]>=mod)C[i][j] -= mod;
            }
        }
    }
    return C;
}

vector<vector<long long>> mmpow(vector<vector<long long>>&A, int n){
    if(n==0){
        int n = A.size();
        vector<vector<long long>> C(n, vector<long long>(n, 0));
        for(int i=0;i<n;i++)C[i][i] = 1;
        return C;
    }
    if(n==1)return A;
    vector<vector<long long>> C = mmpow(A, n/2);
    C = mul(C, C);
    if(n&1)C = mul(C, A);
    return C;
}

int main(){
    int a;
    int n, m, kk;
    int i, v, j;
    cin >> n >> m >> kk;
    vector<long long>A(n);
    for(i=0;i<n;i++){
        cin >> A[i];
    }
    vector<vector<long long>> P(n, vector<long long>(n, 0));
    for(i=0;i<n;i++)P[i][i] = 2*m;
    for(i=0;i<m;i++){
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        P[x][x] -= 1;
        if(P[x][x]<0)P[x][x] += mod;
        P[x][y] += 1;
        P[y][x] += 1;
        P[y][y] -= 1;
        if(P[y][y]<0)P[y][y] += mod;
    }
    vector<vector<long long>> Q = mmpow(P, kk);
    long long p = mpow(2*m, mod-2);
    long long l = mpow(p, kk);
    for(i=0;i<n;i++){
        long long ans = 0;
        for(j=0;j<n;j++){
            ans += Q[i][j]*A[j]%mod;
            ans %= mod;
        }
        ans *= l;
        ans %= mod;
        cout << ans << "\n";
    }
}

#include <bits/stdc++.h>  
#include <ext/pb_ds/assoc_container.hpp>
#define int long long 
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007ll //998244353ll
#define lld long double
#define mii map<int, int>
#define pii pair<int, int>
#define ff first
#define ss second 
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)    
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}
typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
const long long N=100005, INF=2000000000000000000;
lld pi=3.1415926535897932;
int lcm(int a, int b)
{
    int g=__gcd(a, b);
    return a/g*b;
}
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }
typedef vector<int> row; 
typedef vector<row> matrix;

matrix matrix_mul(matrix a, matrix b) {
    int n = a.size(), m = a[0].size(), p = b[0].size();
    assert(m == b.size());
    matrix ans(n, row(p, 0));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < p; ++j) {
            for (int k = 0; k < m; ++k) {
                ans[i][j] += a[i][k] * b[k][j];
                ans[i][j] %= (mod);
            }
        }
    }
    return ans;
}

matrix matrix_pwr(matrix a, int e) {
    if(e==0)
    {
        matrix res=a;
        int n=res.size();
        rep(i,0,n)
        {
            rep(j,0,n)
            {
                if(i==j)
                res[i][j]=1;
                else
                res[i][j]=0;
            }
        }
        return res;
    }
    matrix res = a;
    --e;
    while (e) {
        if (e & 1) {
            res = matrix_mul(res, a);
        }
        a = matrix_mul(a, a);
        e /= 2ll;
    }
    return res;
}
int32_t main()
{
    IOS;
    int n, m, k;
    cin>>n>>m>>k;
    matrix og;
    row ar;
    int deg[n];
    fill(deg, 0);
    rep(i,0,n)
    {
        int x;
        cin>>x;
        ar.pb(x);
    }
    og.pb(ar);
    matrix a;
    ar.clear();
    rep(i,0,n)
    ar.pb(0);
    rep(i,0,n)
    a.pb(ar);
    int inv=power((2ll*m), mod-2, mod);
    rep(i,0,m)
    {
        int x, y;
        cin>>x>>y;
        x--, y--;
        deg[x]++;
        deg[y]++;
        a[x][y]=inv;
        a[y][x]=inv;
    }
    rep(i,0,n)
    {
        a[i][i]=(((2ll*m)-deg[i])*inv)%mod;
    }
    // cout<<inv<<"\n";
    // print2d(a, n-1, n-1);
    // rep(i,0,n)
    // cout<<og[0][i]<<" ";
    // print2d(a, n-1, n-1);
    a=matrix_pwr(a, k);
    // print2d(a, n-1, n-1);
    matrix fin=matrix_mul(og, a);
    rep(i,0,n)
    cout<<fin[0][i]<<"\n";
}