#include <stdio.h>
#define mod 998244353
typedef long long ll;

int main(void) {
  ll i, j, k, n;
  scanf("%lld%lld", &n, &k);
  ll dp[n + 1][n + 1];
  for(i = 0; i <= n; ++i) dp[i][0] = 0, dp[i][i] = 1;
  for(i = 2; i <= n; ++i) for(j = i - 1; j; --j) {
    dp[i][j] = dp[i - 1][j - 1];
    if(j * 2 <= i) dp[i][j] += dp[i][j * 2];
    dp[i][j] %= mod;
  }
  printf("%lld", dp[n][k]);
  return 0;
}
#include <bits/stdc++.h>
 
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vpi;
 
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
 
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define pi pair<int, int>
#define mp make_pair
#define F first
#define S second

ll MOD = 1e9+7;

ll mod_exp(ll a, ll b) {
    ll r = 1;
    while (b) {
        if (b&1) r = (r*a)%MOD;
        a = (a*a)%MOD;
        b >>= 1;
    }
    return r;
}

ll inv(ll a) {
    return mod_exp(a, MOD-2);
}

struct mat {
    int n, m;
    vector<vll> a;
    mat(int n, int m) {
        this->n = n;
        this->m = m;
        a.rsz(n, vll(m, 0));
    }
    mat(vector<vll> a) {
        this->a = a;
        n = a.size();
        m = a[0].size();
    }
    mat operator* (const mat& other) {
        mat ans(n, other.m);
        F0R(i, n) F0R(j, other.m) F0R(k, m) ans.a[i][j] = (ans.a[i][j]+a[i][k]*other.a[k][j])%MOD;
        return ans;
    }
    vll* operator[](int i) {
        return &a[i];
    }
};

mat identity(int n) {
    mat ans(n, n);
    F0R(i, n) ans.a[i][i]=1;
    return ans;
}

mat exp(mat a, ll pow) {
    mat res = identity(a.n);
    while (pow) {
        if (pow&1) res = res*a;
        a = a*a;
        pow >>= 1;
    }
    return res;
}

int n, m, k, x, y;
ll half = inv(2);
vll a;
vector<vi> adj;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m >> k;
    a.rsz(n);
    F0R(i, n) cin >> a[i];
    adj.rsz(n);
    F0R(i, m) {
        cin >> x >> y;
        adj[x-1].pb(y-1);
        adj[y-1].pb(x-1);
    }
    mat mt(n, n);
    F0R(i, n) {
        ll s = inv(2*m);
        mt.a[i][i]=((2*m-adj[i].size())*s)%MOD;
        for (int nb : adj[i]) {
            mt.a[nb][i] = (s)%MOD;
        }
    }
    // cout << inv(2) << ' ' << inv(4) << '\n';
    // F0R(i, n) {F0R(j, n) cout << mt.a[i][j] << ' '; cout << '\n';}
    mt = exp(mt, k);
    mat nodes(1, n);
    F0R(i, n) nodes.a[0][i]=a[i];
    nodes = nodes*mt;
    F0R(i, n) cout << nodes.a[0][i] << '\n';
}
