#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
template <typename T1, typename T2> bool mini(T1 &a, T2 b) {
	if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maxi(T1 &a, T2 b) {
	if (a < b) {a = b; return true;} return false;
}
const int N = 1e5 + 5; 
const int oo = 1e9;
const int mod = 1e9 + 7;

void add(int &a, int b) {
	a += b;
	if (a >= mod)
		a -= mod;
}

struct mat {
	int n;
	vector <vector <int>> f;

	mat(int _n) {
		n = _n;
		f.assign(n, vector <int> (n, 0));
	}

	mat operator * (const mat &m) {
		mat res(n);
		for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
		for (int k = 0; k < n; k++) 	
			add(res.f[i][k], (long long) f[i][j] * m.f[j][k] % mod);
		return res;
	}

	mat one() {
		mat res(n);
		for (int i = 0; i < n; i++)
			res.f[i][i] = 1;
		return res;
	}

	mat binpow(int k) {
		mat n = (*this);
		mat res = one();
		for (; k; k >>= 1, n = n * n) 
			if (k & 1)
				res = res * n;
		return res;
	}

	void print() {
		for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cerr << f[i][j] << " \n"[j == n];
	}
};

int deg[N];
int n,m,k;

int binpow(int x, int k) {
	int res = 1;
	for (; k; k >>= 1, x = (long long) x * x % mod)
		if (k & 1)
			res = (long long) res * x % mod;
	return res;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> k;
	mat base(n);
	for (int i = 0; i < n; i++)
		cin >> base.f[0][i];

	mat mul(n);
	int dv = binpow(2 * m, mod - 2);
	for (int i = 1; i <= m; i++) {
		int u,v;
		cin >> u >> v;
		u--;
		v--;
		deg[u]++;
		deg[v]++;
		mul.f[u][v] = mul.f[v][u] = dv;
	}

	for (int i = 0; i < n; i++) {
		mul.f[i][i] = (1 - (long long) deg[i] * dv) % mod;
		add(mul.f[i][i], mod);			
	}

	base = base * mul.binpow(k);
	for (int i = 0; i < n; i++)
		cout << base.f[0][i] << "\n";
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define rep( i, a, b ) for( int i = (a) ; i <= (b) ; i ++ )
#define per( i, a, b ) for( int i = (a) ; i >= (b) ; i -- )

typedef long long LL;

const int mod = 998244353;
const int MAXN = 105, MAXS = 1e4 + 5;

template<typename _T>
void read( _T &x )
{
    x = 0; char s = getchar(); int f = 1;
    while( s < '0' || '9' < s ) { f = 1; if( s == '-' ) f = -1; s = getchar(); }
    while( '0' <= s && s <= '9' ) { x = ( x << 3 ) + ( x << 1 ) + ( s - '0' ), s = getchar(); }
    x *= f;
}

template<typename _T>
void write( _T x )
{
    if( x < 0 ) putchar( '-' ), x = -x;
    if( 9 < x ) write( x / 10 );
    putchar( x % 10 + '0' );
}

template<typename _T>
inline _T MAX( const _T a, const _T b )
{
	return a > b ? a : b;
}

template<typename _T>
inline _T MIN( const _T a, const _T b )
{
	return a < b ? a : b;
}

template<typename _T>
inline _T ABS( const _T a )
{
	return a < 0 ? -a : a;
}

int dp[2][MAXN][MAXS << 1];

int fac[MAXN];
int W[MAXN];
int N;

inline int Mul( int x, int v ) { return 1ll * x * v % mod; }
inline int Sub( int x, int v ) { return ( x -= v ) < 0 ? x + mod : x; }
inline int Add( int x, int v ) { return ( x += v ) >= mod ? x - mod : x; }
inline void Upt( int &x, const int v ) { x = Add( x, v ); }

int main()
{
	read( N ); int su = 0;
	rep( i, 1, N ) read( W[i] ), su += W[i];
	fac[0] = 1; rep( i, 1, N ) fac[i] = Mul( fac[i - 1], i );
	int pre = 1, nxt = 0;
	dp[nxt][0][su] = 1;
	rep( i, 0, N - 1 )
	{
		pre ^= 1, nxt ^= 1;
		rep( j, 0, N ) rep( k, 0, su << 1 ) dp[nxt][j][k] = 0;
		rep( j, 0, i ) rep( k, 0, su << 1 ) if( dp[pre][j][k] )
		{
			Upt( dp[nxt][j][k - W[i + 1]], dp[pre][j][k] );
			Upt( dp[nxt][j + 1][k + W[i + 1]], dp[pre][j][k] );
		}
	}
	int ans = 0;
	rep( i, 1, N )
		ans = Add( ans, Mul( dp[nxt][i][su], Mul( fac[i], fac[N - i] ) ) );
	write( ans ), putchar( '\n' );
	return 0;
}