#include<iostream>
#include<vector>
using namespace std;
const int BUF = 105;
const int EDGE = BUF * BUF;
const int MOD = 1000000007;


int add(int a, int b) {
    return (a + b) % MOD;
}

int mul(int a, int b) {
    return 1LL * a * b % MOD;
}

int modpow(int p, int n) {
    if (n == 0) return 1;
    int t = modpow(p, n / 2);
    return n % 2 == 0 ? mul(t, t) : mul(p, mul(t, t));
}

vector<vector<int> > matmul(const vector<vector<int> > &a, const vector<vector<int> > &b) {
    int n = a.size();
    vector<vector<int> > c = vector<vector<int> >(n, vector<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] = add(c[i][j], mul(a[i][k], b[k][j]));
            }
        }
    }
    return c;
}

vector<vector<int> > modpow(vector<vector<int> > &p, int n) {
    if (n == 0) {
        vector<vector<int> > ret = vector< vector<int> >(p.size(), vector<int>(p.size(), 0));
        for (int i = 0; i < p.size(); ++i) ret[i][i] = 1;
        return ret;
    }
    vector<vector<int> > t = modpow(p, n / 2);
    return n % 2 == 0 ? matmul(t, t) : matmul(p, matmul(t, t));
}

int inv(int v) {
    return modpow(v, MOD - 2);
}

int divide(int a, int b) {
    return mul(a, inv(b));
}


int nVal, nEdge, nPow;
int val[BUF];
int edge[EDGE][2];

void read() {
    cin >> nVal >> nEdge >> nPow;
    for (int i = 0; i < nVal; ++i) cin >> val[i];
    for (int i = 0; i < nEdge; ++i) {
        cin >> edge[i][0] >> edge[i][1];
        --edge[i][0];
        --edge[i][1];
    }
}


void work() {
    vector< vector<int> > mat(nVal, vector<int>(nVal, 0));

    for (int i = 0; i < nEdge; ++i) {
        mat[edge[i][0]][edge[i][0]] = add(mat[edge[i][0]][edge[i][0]], 1);
        mat[edge[i][0]][edge[i][1]] = add(mat[edge[i][0]][edge[i][1]], 1);
        mat[edge[i][1]][edge[i][0]] = add(mat[edge[i][1]][edge[i][0]], 1);
        mat[edge[i][1]][edge[i][1]] = add(mat[edge[i][1]][edge[i][1]], 1);
        for (int j = 0; j < nVal; ++j) {
            if (j == edge[i][0] || j == edge[i][1]) continue;
            mat[j][j] = add(mat[j][j], 2);
        }
    }

    for (int i = 0; i < nVal; ++i) {
        for (int j = 0; j < nVal; ++j) {
            mat[i][j] = divide(mat[i][j], 2 * nEdge);
        }
    }

    vector<vector<int> > ret = modpow(mat, nPow);
    
    vector<int> ans(nVal, 0);
    for (int i = 0; i < nVal; ++i) {
        for (int j = 0; j < nVal; ++j) {
            ans[i] = add(ans[i], mul(ret[i][j], val[j]));
        }
    }

    for (int i = 0; i < nVal; ++i) {
        cout << ans[i] << endl;
    }
}


int main() {
    read();
    work();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)
typedef pair<int,int> pii;
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)
#define x first
#define y second

const int N = 105,MOD = 1e9+7;
pii edges[N * N];
int deg[N];

struct Mat
{
    int c[N][N];
    Mat()
    {
        memset(c,0,sizeof c);
    }
    Mat operator*(const Mat& r) const
    {
        Mat res;
        forn(i,1,N - 1) forn(j,1,N - 1) forn(k,1,N - 1) res.c[i][j] = (res.c[i][j] + 1ll*c[i][k] * r.c[k][j] % MOD) % MOD;
        return res;
    }
    void operator*(int r) 
    {
        forn(i,1,N - 1) forn(j,1,N - 1) c[i][j] = 1ll*c[i][j] * r % MOD;
    }
};

Mat qpow(Mat a,int b,int MOD)
{
    Mat res;forn(i,1,N - 1) res.c[i][i] = 1;
    while(b)
    {
        if(b & 1)   res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

int qpow(int a,int b,int MOD)
{
    int res = 1;
    while(b)
    {
        if(b & 1)   res = 1ll * res * a % MOD;
        a = 1ll * a * a % MOD;
        b >>= 1;
    }
    return res;
}

int main()
{
    // freopen("D://OJCodes//TTT//in.txt","r",stdin);
    // freopen("D://OJCodes//TTT//out.txt","w",stdout);
    
    int n,m,k;scanf("%d%d%d",&n,&m,&k);
    Mat f,B;forn(i,1,n)   scanf("%d",&f.c[1][i]);

    forn(i,1,m)
    {
        int u,v;scanf("%d%d",&u,&v);
        ++deg[u];++deg[v];
        edges[i] = {u,v};
    }

    int m_2fact = qpow(m * 2,MOD - 2,MOD);
    
    forn(i,1,m)
    {
        int u = edges[i].x,v = edges[i].y;
        B.c[u][v] = m_2fact;
        B.c[v][u] = m_2fact;
    }

    forn(i,1,n) B.c[i][i] = (2 * m - deg[i]) * 1ll * m_2fact % MOD;
    

    B = qpow(B,k,MOD);
    f = f * B;
    forn(i,1,n) printf("%d\n",f.c[1][i]);


    // fclose(stdin);
    // fclose(stdout);
    return 0;
}
