#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF = 4e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void print() { print0("\n"); }
template<typename Head,typename... Tail>void print(Head head,Tail... tail){print0(head);if(sizeof...(Tail)>0)print0(" ");print(tail...);}
// clang-format on

const ll MODULO = 998244353LL;
ll mod_pow(ll x, ll n, ll modval) {
    if (x == 0) {
        return 0;
    }
    if (n == 0) {
        return 1;
    }
    ll res = mod_pow(x * x % modval, n / 2, modval);
    if (n & 1) {
        res = res * x % modval;
    }
    return res;
}
ll mpow(ll x, ll n) {
    return mod_pow(x, n, MODULO);
}

int main() {
    ll n, m, k;
    cin >> n >> m >> k;

    ll ans = 0;
    if (n == 1 && m == 1) {
        print(k);
        return 0;
    } else if (n == 1) {
        for (ll x = 1; x <= k; x++) {
            ll mx = mpow(k - x + 1, m) - mpow(k - x, m);
            if(mx<0)mx+=MODULO;
            ans = (ans + mx) % MODULO;
        }
        print(ans);
    } else if (m == 1) {
        for (ll x = 1; x <= k; x++) {
            ll nx = mpow(x, n) - mpow(x - 1, n);
            if (nx < 0) nx += MODULO;
            ans = (ans + nx) % MODULO;
        }
        print(ans);
    } else {
        for (ll x = 1; x <= k; x++) {
            ll nx = mpow(x, n) - mpow(x - 1, n);
            if (nx < 0) nx += MODULO;
            ll mx = mpow(k - x + 1, m);
            ans = (ans + nx * mx) % MODULO;
        }
        print(ans);
    }
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=1000000007;
constexpr ll INF=2e18;

ll power(ll x, ll y){
    x%=MOD;
    ll ret=1;
    while(y){
        if(y&1) ret=ret*x%MOD;
        x=x*x%MOD;
        y>>=1;
    }
    return ret;
}

ll divid(ll x, ll y){
    x%=MOD;
    return x*power(y,MOD-2)%MOD;
}

VVI prd(VVI& a, VVI& b){
    int n=a.size(), m=b[0].size();
    VVI ret(n,VI(m));
    REP(i,n)REP(j,m){
        ll sum=0;
        REP(k,a[0].size()){
            sum=(sum+a[i][k]*b[k][j]%MOD)%MOD;
        }
        ret[i][j]=sum;
    }
    return ret;
}

VVI matrix_power(VVI x, ll y){
    int n=x.size();
    VVI ret(n,VI(n,0));
    REP(i,n) ret[i][i]=1;
    while(y){
        if(y&1) ret=prd(ret,x);
        x=prd(x,x);
        y>>=1;
    }
    return ret;
}

int main(){
    int n, m, k; cin >> n >> m >> k;
    VVI a(1,VI(n)); REP(i,n) cin >> a[0][i];
    VVI mx(n,VI(n,0));
    REP(i,n) mx[i][i]=m;
    ll p=divid(1,2);
    int x, y;
    REP(i,m){
        cin >> x >> y;
        x--, y--;
        mx[x][x]=(mx[x][x]+MOD-p)%MOD;
        mx[y][y]=(mx[y][y]+MOD-p)%MOD;
        mx[x][y]=(mx[x][y]+p)%MOD;
        mx[y][x]=(mx[y][x]+p)%MOD;
    }
    p=divid(1,m);
    REP(i,n)REP(j,n){
        mx[i][j]=mx[i][j]*p%MOD;
    }
    mx=matrix_power(mx,k);
    VVI ans=prd(a,mx);
    REP(i,n) cout << ans[0][i] << endl;
    return 0;
}