#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector<ll> vec, temp, temp2;
set<vector<ll>> st;
ll width, amount;
bool fail;

void center(ll a)
{
    temp2.clear();
    ll siz = temp[a];
    for(ll i = a-siz; i <= a+siz; i++)
    {
        temp2.push_back(temp[i]);
    }
    if(st.count(temp2))
    {
        fail = true;
        // cout << "failed on \n";
        // for(ll num : temp2)
        // {
        //     cout << num << " ";
        // }
        // cout << "\n";
    }
    st.insert(temp2);
}

void thing()
{
    temp.assign(3*width, 0);
    for(ll i = 0; i < 3*width; i++)
    {
        temp[i] = vec[i%width];
    }
    for(ll i = width; i < 2*width; i++)
    {
        center(i);
    }
}

void solve()
{
    thing();
    for(ll i = 0; i < width/2; i++)
    {
        vec[i] = vec[width-i];
    }
    thing();
}

void loop(ll it, vector<ll> pointsvec)
{
    if(it == amount)
    {
        fail = false;
        vec = pointsvec;
        st.clear();
        solve();
        if(!fail)
        {
            cout << "found\n";
            for(ll i = 0; i < width; i++)
            {
                printf("%lld ", vec[i]);
            }
            printf("\n");
        }
    }
    else
    {
        for(ll i = 0; i < width; i++)
        {
            for(ll j = 2; j <= 4; j++)
            {
                vector<ll> nxt = pointsvec;
                nxt[i] = j;
                loop(it+1, nxt);
            }
        }
    }
}

int main()
{
    scanf("%lld %lld", &width, &amount);
    vec.assign(width, 1);
    loop(0, vec);
}