#include <math.h>
#include <stdio.h>
#include <time.h>

#include <algorithm>
//#include <atcoder/all>
#include <cassert>
#include <complex>
#include <cstdint>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// using namespace atcoder;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vii = vector<int>;
using vvii = vector<vector<int>>;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout << "YES" << endl
#define cNO cout << "NO" << endl
#define cYes cout << "Yes" << endl
#define cNo cout << "No" << endl
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define rRep(i, a, b) for (ll i = a; i >= b; i--)
#define crep(i) for (char i = 'a'; i <= 'z'; ++i)
#define psortsecond(A, N) \
  sort(A, A + N,          \
       [](const pii& a, const pii& b) { return a.second < b.second; });
#define ALL(x) (x).begin(), (x).end()
#define debug(v)      \
  cout << #v << ":";  \
  for (auto x : v) {  \
    cout << x << ' '; \
  }                   \
  cout << endl;
#define endl '\n'
int ctoi(const char c) {
  if ('0' <= c && c <= '9') return (c - '0');
  return -1;
}
ll gcd(ll a, ll b) { return (b == 0 ? a : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
constexpr ll MOD = 1000000007;
constexpr ll INF = 1000000011;
constexpr ll MOD2 = 998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS = 10e-8;
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return 1;
  }
  return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return 1;
  }
  return 0;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto&& x : v) is >> x;
  return is;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first;
  is >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator>>(ostream& os, const pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <class T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto i = begin(v); i != end(v); ++i) {
    if (i != begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

int main() {
  ll N, K, M;
  cin >> N >> K >> M;
  vvll dp(102, vll(125000, 0));
  dp[0][0] = 1;
  rep(i, 101) {
    rep(j, 125000) {
      dp[i + 1][j] += dp[i][j];
      if (j >= i + 1) {
        dp[i + 1][j] += dp[i + 1][j - i - 1];
      }
      if (j >= (i + 1) * (K + 1)) {
        dp[i + 1][j] -= dp[i][j - (i + 1) * (K + 1)];
      }
      dp[i + 1][j] = (dp[i + 1][j] + 2 * M) % M;
    }
  }
  // rep(i, 3) {
  //   rep(j, 10) { cout << dp[i][j] << " "; }
  //   cout << endl;
  // }
  rep(i, N) {
    ll l = i, r = N - i - 1;
    ll E = 0;
    rep(i, 125000) {
      E += dp[l][i] * dp[r][i];
      E %= M;
    }
    E *= (K + 1);
    E = (E - 1 + M) % M;
    cout << E << endl;
  }
}
#include <bits/stdc++.h>
using namespace std;
int n, TTT;
const int mod = 1e9 + 7;
long long ksm(long long a, int n)
{
    if (n == 1)
        return a;
    if (n == 0)
        return 1;
    long long ans = ksm(a, n >> 1);
    ans = ans * ans % mod;
    if (n & 1)
        ans = ans * a % mod;
    return ans;
}
struct matrix
{
    long long a[101][101], n, m;
    friend matrix operator*(matrix a, matrix b)
    {
        matrix c;
        memset(c.a, 0, sizeof(c.a));
        c.n = a.n;
        c.m = b.m;
        // cerr<<c.n<<' '<<c.m<<endl
        for (int i = 1; i <= a.n; i++)
        {
            for (int j = 1; j <= a.m; j++)
            {
                for (int k = 1; k <= b.m; k++)
                {
                    // cerr << c.a[i][k] << " ";
                    c.a[i][k] += a.a[i][j] * b.a[j][k] % mod;
                    c.a[i][k] %= mod;
                    // cerr << a.a[i][j] << " " << b.a[j][k] << " " << c.a[i][k] << " " << i << " " << j << " " << k << endl;
                }
            }
        }
        return c;
    }
} e, f;

matrix ksmm(matrix a, int n)
{
    matrix ans = a;
    memset(ans.a, 0, sizeof(ans.a));
    for (int i = 1; i <= ans.n; i++)
        ans.a[i][i] = 1;
    for (; n; n >>= 1, a = a * a)
        if (n & 1)
            ans = ans * a;
    return ans;
}
int m, k;
int in[1001];
int main()
{
    cin >> n >> m >> k;
    f.m = e.n = e.m = n;
    f.n = 1;
    for (int i = 1; i <= n; i++)
        cin >> f.a[1][i];
    // for(int i=1;i<=n;i++)cout<<f.a[1][n]
    long long tmp = ksm(2 * m % mod, mod - 2);
    cerr << tmp << endl;
    for (int i = 1; i <= m; i++)
    {
        int x, y;
        cin >> x >> y;
        ++in[x];
        ++in[y];
        e.a[x][y] = tmp;
        e.a[y][x] = tmp;
    }
    // cerr << "!!!" << endl;
    for (int i = 1; i <= n; i++)
    {
        e.a[i][i] = (2 * m - in[i] + mod) % mod * tmp % mod;
        // cout << e.a[i][i] << endl;
    }
    // cerr << "!!!" << endl;
    e = ksmm(e, k);
    f = f * e;
    for (int i = 1; i <= n; i++)
    {
        cout << f.a[1][i] << endl;
    }
    return 0;
}