#include <bits/stdc++.h>
#define INT long long int
#define MOD 998244353
#define oo 6*(1e18)
using namespace std;
INT rnd(INT x)
{
    INT ret = 0;
    for(int i = 0 ; i < 60 ; i++ ) ret<<=1, ret+=rand()%2;
    return ret%x;
}
int main()
{
    freopen(".25.in","w",stdout);
    INT n, T;
    ios::sync_with_stdio(false);
    cin>>n>>T;
    srand(time(NULL));
    cout<<n<<" "<<T<<endl;
    for(int i = 0 ; i < n ; i++ )
        cout<<rnd(4)<<" ";
}
