#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
#include<iostream>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
int dp[2][100][100];
int AB[200], *A = AB, *B = AB + 100;
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N, M, K;
	cin >> N >> M >> K;
	rep(i, N) {
		cin >> A[i];
	}
	auto mae = dp[0], ato = dp[1];
	int are = modpow(2 * M, mod - 2);

	rep(i, M) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		if (x < y) swap(x, y);
		mae[x][x]--;
		mae[x][y]++;
		mae[y][y]--;
	}
	rep(x, N) rep(y, x + 1) {
		mae[x][y] = (ll(mae[x][y] + mod) * are + (x == y)) % mod;
		mae[y][x] = mae[x][y];
	}

	const ll ma = (1ll << 32) - 1;

	rep(i, 30) {
		if (K >> i & 1) {
			rep(i, N) {
				ll t1 = 0, t2 = 0;
				rep(j, N) {
					auto tmp = (ll)mae[i][j] * A[j];
					t1 += tmp >> 32;
					t2 += tmp & ma;
				}
				B[i] = ((t1 % mod << 32) + t2) % mod;
			}
			swap(A, B);
		}
		if (!K | i >= 31 - __builtin_clz(K)) break;
		rep(x, N) rep(y, x + 1) {
			auto tmp1 = mae[x];
			auto tmp2 = mae[y];
			ll t1 = 0, t2 = 0;
			rep(z, N) {
				auto tmp = *tmp1++ * (ll)*tmp2++;
				t1 += tmp >> 32;
				t2 += tmp & ma;
			}
			ato[y][x] = (ato[x][y] = ((t1 % mod << 32) + t2) % mod);
		}
		swap(mae, ato);
	}

	rep(i, N) co(A[i]);


	Would you please return 0;
}
/*
 * TheMartian0x48
 */
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

// clang-format off
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define per(i, a, b) for (int i = a; i >= (b); --i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define rll(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vii = vector<long long>;
// (* read and write *)
template <class T>
void re(vector<T> &v, int n) {v.resize(n); for (auto &e : v) cin >> e;}
template <class T> 
void re(vector<T> &v){for (auto &e : v) cin >> e;}
// clang-format on

void solve() {
  
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  int a, b, c; cin >> a >> b >> c;
  int res = max(a + b, a + c);
  res = max(res, b + c);
  cout << res;
}
