#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int N, M;
    cin>>N>>M;

    long long MOD = 998244353;
    vector<vector<long long>> C(N+1, vector<long long>(N+1));
    for (int i=0; i<=N; i++)
    {
        C[i][0] = 1;
        for (int j=1; j<i; j++)
            C[i][j] = (C[i-1][j-1]+C[i-1][j])%MOD;
        C[i][i] = 1;
    }

    //for (int i=0; i<=N; i++)
    //{
    //    for (int j=0; j<=i; j++)
    //        cout<<" "<<C[i][j];
    //    cout<<endl;
    //}

    vector<long long> T(N+1);
    T[0] = 1;
    for (int i=0; i<16; i++)
    {
        vector<long long> P(N+1);
        P.swap(T);
        for (int j=0; j<=N; j++)
            for (int k=0; k<=N; k+=2)
                if (j%2==(M>>i&1))
                    (T[(j>>1)+(k>>1)] += C[N][k]*P[j]%MOD) %= MOD;
    }
    cout<<T[0]<<endl;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)

using namespace std;
using LL = long long;
using P = pair<int,int>;
using vv = vector<vector<int>>;
const int INF = (int)1e9;
const LL LINF = (LL)1e18;

long long const mod = 1000000007;
struct mint{
	long long val;
	mint(long long val = 0): val(val % mod) {}
	mint& operator += (const mint n){
		val += n.val;
		if(val >= mod) val -= mod;
		return *this;
	}
	mint& operator -= (const mint n){
		val -= n.val;
		if(val < 0) val += mod;
		return *this;
	}
	mint& operator *= (const mint n){
		val *= n.val;
		val %= mod;
		if(val < 0) val += mod;
		return *this;
	}
	mint operator + (const mint n) const{
		mint res(*this);
		return res += n;
	}
	mint operator - (const mint n) const{
		mint res(*this);
		return res -= n;
	}
	mint operator * (const mint n) const{
		mint res(*this);
		return res *= n;
	}
	mint pow(long long n) const{
		if(n == 0) return 1;
		mint m = pow(n >> 1);
		m *= m;
		if(n & 1) m *= *this;
		return m;
	}
	// mint division for prime mod
	mint inv() const{
		return pow(mod - 2);
	}
	mint& operator /= (const mint n){
		return (*this) *= n.inv();
	}
	mint operator / (const mint n) const{
		mint res(*this);
		return res /= n;
	}
};

template<typename T>
struct matrix{
	int row, column;
	vector<vector<T>> mat;

	matrix(int r = 0, int c = 0, T val = 0) : row(r), column(c) {
		mat = vector<vector<T>>(r, vector<T>(c, val));
	}
	vector<T>& operator [] (const int num) {
		return mat[num];
	}
	matrix& operator += (const matrix A) {
		assert(row == A.row && column == A.column);
		for(int i = 0; i < row; i++) {
			for(int j = 0; j < column; j++) {
				mat[i][j] += A.mat[i][j];
			}
		}
		return *this;
	}
	matrix& operator -= (const matrix A) {
		assert(row == A.row && column == A.column);
		for(int i = 0; i < row; i++) {
			for(int j = 0; j < column; j++) {
				mat[i][j] -= A.mat[i][j];
			}
		}
		return *this;
	}
	matrix& operator *= (const matrix A) {
		assert(column == A.row);
		matrix B(row, A.column);
		for(int i = 0; i < row; i++) {
			for(int k = 0; k < column; k++) {
				for(int j = 0; j < A.column; j++) {
					B.mat[i][j] += mat[i][k] * A.mat[k][j];
				}
			}
		}
		return *this = B;
	}
	matrix& operator *= (long long k) {
		for(int i = 0; i < row; i++) {
			for(int j = 0; j < column; j++) {
				mat[i][j] *= k;
			}
		}
		return *this;
	}
	matrix operator + (const matrix A) const {
		assert(row == A.row && column == A.column);
		matrix B = *this;
		return B += A;
	}
	matrix operator - (const matrix A) const {
		assert(row == A.row && column == A.column);
		matrix B = *this;
		return B -= A;
	}
	matrix operator * (const matrix A) const {
		assert(column == A.row);
		matrix B = *this;
		return B *= A;
	}
	matrix operator * (long long k) const {
		matrix B = *this;
		return B *= k;
	}
	vector<T> operator * (const vector<int> A) const {
		int vector_size = A.size();
		assert(column == vector_size);
		vector<T> B(row);
		for(int i = 0; i < row; i++) {
			for(int j = 0; j < column; j++) {
				B[i] += mat[i][j] * A[j];
			}
		}
		return B;
	}
	matrix pow(long long n) const {
		assert(row == column);
		if(n == 0){
			matrix E(row, column);
			for(int i = 0; i < row; i++) {
				E.mat[i][i] = 1;
			}
			return E;
		}
		matrix A = pow(n >> 1);
		A *= A;
		if(n & 1) A *= *this;
		return A;
	}
};

int main(){
	int N, M, K;
	cin >> N >> M >> K;
	vector<int> A(N);
	rep(i,N) cin >> A[i];
	vv G(N);
	rep(i,M){
		int x, y;
		cin >> x >> y;
		x--; y--;
		G[x].emplace_back(y);
		G[y].emplace_back(x);
	}
	matrix<mint> mat(N, N), F(N, N);
	rep(i,N){
		int s = G[i].size();
		mint coef = M * 2 - s, tot = M * 2;
		coef *= tot.inv();
		mat[i][i] = coef;
		for(auto j : G[i]) mat[i][j] = tot.inv();
	}
	F = mat.pow(K);
	vector<mint> ans = F * A;
	rep(i,N) cout << ans[i].val << endl;

	return 0;
}
