#include <bits/stdc++.h>

using ll = long long int;
using P = std::pair<int, int>;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rag(con) std::begin(con), std::end(con)

constexpr ll mod = 998244353;

ll pow(ll x, ll m)
{

    ll re = 1, y = 1;

    for (int i = 0; i < 60; ++i)
    {
        if (m & y)
            re = re * x % mod;
        x = x * x % mod;
        y *= 2;
    }

    return re;
}

ll inv(ll x)
{

    return pow(x, mod - 2);
}

class mint
{
    ll num = 0;

public:
    mint(ll x = 0) : num(x) {}

    mint operator+(const mint &rhs) const
    {
        return (num + rhs.num) % mod;
    }
    mint operator*(const mint &rhs) const
    {
        return num * rhs.num % mod;
    }
    mint operator-(const mint &rhs) const
    {
        return (num - rhs.num + mod) % mod;
    }
    mint operator/(const mint &rhs) const
    {
        return num * inv(rhs.num) % mod;
    }
    mint operator+=(const mint &rhs)
    {
        return *this = *this + rhs;
    }
    mint operator*=(const mint &rhs)
    {
        return *this = *this * rhs;
    }
    mint operator-=(const mint &rhs)
    {
        return *this = *this - rhs;
    }
    mint operator/=(const mint &rhs)
    {
        return *this = *this / rhs;
    }
    friend std::ostream &operator<<(std::ostream &os, const mint &rhs);
    friend std::istream &operator>>(std::istream &is, const mint &rhs);
};

std::ostream &operator<<(std::ostream &os, const mint &rhs)
{

    os << rhs.num;

    return os;
}

/*std::istream &operator>>(std::istream &is, const mint &rhs)
{
    is >> rhs.num;

    return is;
}*/

constexpr int MAX = 2 * 1e5 + 10;
mint s[MAX], b[MAX], a[MAX];
mint fact[MAX];

mint comb(ll x, ll y)
{
    return fact[x] / fact[x - y] / fact[y];
}

int main()
{
    int n, K;

    std::cin >> n >> K;

    rep(i, n)
    {
        ll in;
        std::cin >> in;
        b[i] = a[i] = in;
    }

    fact[0] = 1;
    for (int i = 1; i <= K; ++i)
        fact[i] = fact[i - 1] * i;

    s[0] = 1;

    for (int i = 1; i <= K; ++i)
    {
        rep(j, n)
            s[i] += b[j];

        rep(j, n)
            b[j] *= a[j];
    }

    mint p2 = 1;

    for (int x = 1; x <= K; ++x)
    {
        mint ans = (mint(n - 1) - p2) * s[x];
        mint res = 0;
        for (int i = 0; i <= x; ++i)
        {
            res += comb(x, i) * s[x - i] * s[i];
        }
        res /= 2;
        ans += res;
        std::cout << ans << std::endl;
        p2 *= 2;
    }

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

#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(a) (a).begin(), (a).end()
#define uniq(a) (a).erase(unique(all(a)), (a).end())
#define bit(n) (1LL << (n))
#define dump(a) cerr << #a " = " << (a) << endl
#define fin(a)                                                                                                         \
    cout << (a) << endl;                                                                                               \
    return 0
using vint = vector<int>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template <typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr int DY[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
constexpr int DX[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
int sign(int a) {
    return (a > 0) - (a < 0);
}
int cdiv(int a, int b) {
    return (a - 1 + b) / b;
}
template <typename T> T sq(T a) {
    return a * a;
}
template <typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &a) {
    os << "(" << a.first << ", " << a.second << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &a) {
    os << "(";
    for (auto itr = a.begin(); itr != a.end(); itr++) {
        os << *itr << (next(itr) != a.end() ? ", " : "");
    }
    os << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const deque<T> &a) {
    os << "(";
    for (auto itr = a.begin(); itr != a.end(); itr++) {
        os << *itr << (next(itr) != a.end() ? ", " : "");
    }
    os << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &a) {
    os << "{";
    for (auto itr = a.begin(); itr != a.end(); itr++) {
        os << *itr << (next(itr) != a.end() ? ", " : "");
    }
    os << "}";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const multiset<T> &a) {
    os << "{";
    for (auto itr = a.begin(); itr != a.end(); itr++) {
        os << *itr << (next(itr) != a.end() ? ", " : "");
    }
    os << "}";
    return os;
}
template <typename T, typename U> ostream &operator<<(ostream &os, const map<T, U> &a) {
    os << "{";
    for (auto itr = a.begin(); itr != a.end(); itr++) {
        os << *itr << (next(itr) != a.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

signed main() {
    int a, b;
    cin >> a >> b;
    int ans = 1;
    reps(i, 220000) {
        int x = cdiv(a, i) * i;
        int y = x + i;
        if (a <= x && y <= b) {
            chmax(ans, i);
        }
    }
    cout << ans << endl;
}