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

long long MOD=998244353;

long long MODpow(long long a,int b){
	if(b==0)return 1;
	if(b%2==0){
		long long t=MODpow(a,b/2);
		return (t*t)%MOD;
	}
	return (a*MODpow(a,b-1))%MOD;
}

int main(){
	int N,M,K;
	cin >> N >> M >> K;
	vector<long long> A(K+1,0);
	vector<long long> B(K+1,0);
	
	for(int i=1;i<=K;i++)A[i]=MODpow(i,N);
	for(int i=1;i<=K;i++)B[i]=MODpow(i,M);
	
	long long ans=0;
	for(int i=1;i<=K;i++){
		int j=K-i+1;
		if(M==1)j=1;
		long long add=(A[i]-A[i-1]+MOD)*B[j];
		if(N==1)add=(A[i]-A[i-1])*(B[j]-B[j-1]);
		add%=MOD;
		ans+=add;
		ans%=MOD;
	}
	cout << ans << endl;
	return 0;
}
#include <bits/stdc++.h>

#define TRACE(x) cerr << #x << " = " << x << endl

#define pb push_back
#define mp make_pair
#define fi first
#define se second

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)

#define SZ(x) (int)(x).size()

using namespace std;

typedef long long ll;
typedef double lf;
typedef pair<int, int> pii;
typedef vector<int> VI;

template<class Num>
Num mabs(Num A){
  if(A < 0) return -A;
  return A;
}

const int mod = 1e9 + 7;

inline int add(int a, int b){
  int ret = a + b;
  if(ret >= mod) ret -= mod;
  return ret;
}

inline int mult(int a, int b){
  return (int)((ll)a * b % mod);
}

int digni(int x, int y){
  int ret = 1;
  while(y){
    if(y % 2 == 1)
      ret = mult(ret, x);
    x = mult(x, x);
    y /= 2;
  }
  return ret;
}

int inverse(int x){
  return digni(x, mod - 2);
}

inline int divi(int a, int b){
  return mult(a, inverse(b));
}

inline int sub(int a, int b){
  int ret = a - b;
  if(ret < 0) ret += mod;
  return ret;
}

struct Matrix{
  int n, m;
  vector<VI> mat;
  Matrix(){}
  Matrix(int _n, int _m){
    n = _n; m = _m;
    mat.resize(n + 1, VI(m + 1, 0));
  }

  int& operator()(int x, int y){
    return mat[x][y];
  }

  int operator()(int x, int y) const{
    return mat[x][y];
  }
  
  Matrix operator*(const Matrix &A){
    Matrix ret(n, A.m);
    FOR(i, 1, n + 1){
      FOR(j, 1, A.m + 1){
        FOR(k, 1, m + 1){
          ret(i, j) = add(ret(i, j), mult(mat[i][k], A(k, j)));
        }
      }
    }

    return ret;
  }
};


Matrix matrix_exp(Matrix &A, int y){
  //mora biti kvadratna 
  int n = A.n;
  assert(A.n == A.m);
  Matrix ret(n, n);
  FOR(i, 1, n + 1) ret(i, i) = 1;
  while(y){
    if(y % 2 == 1)
      ret = ret * A;
    A = A * A;
    y /= 2;
  }
  return ret;
}


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
    
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n + 1);
  FOR(i, 1, n + 1){
    cin >> a[i];
  }

  vector<int> E[n + 1];
  REP(i, m){
    int u, v; cin >> u >> v;
    E[u].pb(v);
    E[v].pb(u);
  }
  

  Matrix poc(1, n);
  Matrix prijelaz(n, n);
  const int pola = divi(1, 2);

  FOR(i, 1, n + 1){ 
    poc(1, i) = a[i];
    int deg = SZ(E[i]);
    int prob = divi(deg, m);
    prijelaz(i, i) = sub(1, mult(pola, prob));
  
    for(int nei : E[i]){
      prijelaz(i, nei) = divi(1, mult(2, m));
    }

  }
  
  prijelaz = matrix_exp(prijelaz, k);
  Matrix sol = poc * prijelaz;
  
  FOR(i, 1, n + 1){
    cout << sol(1, i) << '\n';
  }

  return 0;
}
