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


#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace
#define mp make_pair


#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())
#define INT(...) int __VA_ARGS__; IN(__VA_ARGS__);
#define LL(...) ll __VA_ARGS__; IN(__VA_ARGS__);
#define STR(...) string __VA_ARGS__; IN(__VA_ARGS__);
#define CHR(...) char __VA_ARGS__; IN(__VA_ARGS__);
#define LD(...) ld __VA_ARGS__; IN(__VA_ARGS__);


/* const ll mod = 1e9 + 7; */
const ll mod = 998244353;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;

void IN() {}

template <class Head, class... Tail>
void IN(Head &head, Tail &... tail) {
  cin >> head;
  IN(tail...);
}

class mint {
  private: 
    ll x;

  public:
    constexpr mint(const ll x = 0) noexcept : x((x % mod + mod) % mod) {}
    constexpr ll value() noexcept { return x; }
    constexpr mint operator += (const mint right) noexcept {
      if ((x += right.x) >= mod) x -= mod;
      return *this;
    }
    constexpr mint operator -= (const mint right) noexcept {
      if ((x += mod - right.x) >= mod) x -= mod;
      return *this;
    }
    constexpr mint operator *= (const mint right) noexcept {
      x = x * right.x % mod;
      return *this;
    }
    constexpr mint operator /= (const mint right) noexcept {
      return *this *= right.inv();
    }
    constexpr mint operator + (const mint right) const noexcept {
      return mint(*this) += right;
    }
    constexpr mint operator - (const mint right) const noexcept {
      return mint(*this) -= right;
    }
    constexpr mint operator / (const mint right) const noexcept {
      return mint(*this) /= right;
    }
    constexpr mint operator * (const mint right) const noexcept {
      return mint(*this) *= right;
    }
    constexpr mint inv() const {
      return pow(mod-2);
    }
    constexpr mint pow(ll n) const {
      if (n == 0) return 1;
      mint a = pow(n>>1);
      a *= a;
      if (n & 1) a *= *this;
      return a;
    }
};

signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  LL(a, b, c);

  mint aa = (a * (a + 1)) / 2;
  mint bb = (b * (b + 1)) / 2;
  mint cc = (c * (c + 1)) / 2;

  cout << (aa * bb * cc).value() << endl;

}

/*
 * @date:2021-04-24 20:37:33
 * @source:https://atcoder.jp/contests/abc199/tasks/abc199_f
*/
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 100 + 5;
const int MOD = 1e9 + 7;

int N, M, K;
long long A[MAXN];
int Num[MAXN];

struct Matrix {
    long long A[MAXN][MAXN];
    Matrix() {
        memset(A, 0, sizeof A);
    }
    Matrix operator * (const Matrix &x) const {
        Matrix c = Matrix();
        for (int i = 1; i <= N; ++i) {
            for (int j = 1; j <= N; ++j) {
                for (int k = 1; k <= N; ++k) {
                    c.A[i][j] = (c.A[i][j] + A[i][k] * x.A[k][j] % MOD) % MOD;
                }
            }
        }
        return c;
    }
} a;

long long poww(long long x, int t) {
    long long res = 1;
    for (; t; t >>= 1) {
        if (t & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

Matrix poww(Matrix &x, int t) {
    Matrix res = x;
    for (--t; t; t >>= 1) {
        if (t & 1) res = res * x;
        x = x * x;
    }
    return res;
}

int main() {
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i) scanf("%lld", &A[i]);
    if (!K) {
        for (int i = 1; i <= N; ++i) {
            printf("%lld\n", A[i]);
        }
        return 0;
    }
    long long p = poww(M, MOD - 2), two = poww(2, MOD - 2);
    for (int i = 1, u, v; i <= M; ++i) {
        scanf("%d%d", &u, &v);
        ++Num[u], ++Num[v];
        a.A[u][v] = a.A[v][u] = p * two % MOD;
    }
    for (int i = 1; i <= N; ++i) {
        a.A[i][i] = p * (M - Num[i] + two * Num[i]) % MOD;
    }
    a = poww(a, K);
    for (int i = 1; i <= N; ++i) {
        long long x = 0;
        for (int j = 1; j <= N; ++j) {
            x = (x + A[j] * a.A[i][j]) % MOD;
        }
        printf("%lld\n", x);
    }
    return 0;
}