#include <bits/stdc++.h>
using namespace std;
const int N = 100005,P = 998244353,I2 = (P + 1) / 2;
using ll = long long;
ll qpow(ll a,ll b)
{
    ll ret = 1;
    while (b)
    {
        if (b & 1) ret = ret * a % P;
        a = a * a % P;b >>= 1;
    }
    return ret;
}
ll a[N],b[N];int n,x;
map<vector<ll>,int> lst;
int main ()
{
    // freopen("noodle.in","r",stdin);
    freopen("noodle.out","w",stdout);
    ios::sync_with_stdio(false);
    cin >> n >> x;a[x] = 1;
    for (int i = 1;i <= 10000;i++)
    {
        fill(b + 1,b + n + 1,0);
        for (int j = 1;j <= n;j++) b[(j + 1) / 2] += a[j] * I2 % P,b[n - (j + 1) / 2 + 1] += a[j] * I2 % P;
        // ll tt = qpow(2,i) / n;if (abs((tt + 1) * n - qpow(2,i)) < abs(tt * n - qpow(2,i))) ++tt;
        for (int j = 1;j <= n;j++) a[j] = b[j] % P;
        vector<ll> cur(n);for (int j = 1;j <= n;j++) cur[j - 1] = a[j] * qpow(2,i) % P;
        for (int j = 1;j < n;j++) cur[j] -= cur[0];
        cur[0] = 0;
        cerr << i << ":" << lst[cur] << endl;if (i == 510) break;
        lst[cur] = i;
        // cout << "\t\t\t/" << qpow(2,i) << endl;
        cout << endl;
    }
    return 0;
}