/** e==m*pow(c,2) **/
#include<bits/stdc++.h>
#define lli long long int
#define pii pair<lli, lli>
#define pb push_back
#define endl '\n'
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie();
cout.tie();
priority_queue<int> q;
long long int power[60];power[0]=1;
for(int i=1;i<=60;i++) power[i]= power[i-1]*2LL;
long long int a;
int k, m;
cin >> a >> k;
while(a)
{
m = log2(a);
q.push(m);
a -= power[m];
k--;
}
while(k)
{
m = q.top();
q.pop();
q.push(m-1);
q.push(m-1);
k--;
}
while(!q.empty())
{
cout<<q.top()<<' ';
q.pop();
}
return 0;
}
LyoqIGU9PW0qcG93KGMsMikgKiovCgojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgojZGVmaW5lIGxsaSBsb25nIGxvbmcgaW50CiNkZWZpbmUgcGlpIHBhaXI8bGxpLCBsbGk+CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgZW5kbCAnXG4nCiNkZWZpbmUgeWVzIGNvdXQ8PCJZRVMiPDxlbmRsCiNkZWZpbmUgbm8gY291dDw8Ik5PIjw8ZW5kbAoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoKTsKICAgIGNvdXQudGllKCk7CiAgICBwcmlvcml0eV9xdWV1ZTxpbnQ+IHE7CiAgICBsb25nIGxvbmcgaW50IHBvd2VyWzYwXTtwb3dlclswXT0xOwogICAgZm9yKGludCBpPTE7aTw9NjA7aSsrKSBwb3dlcltpXT0gcG93ZXJbaS0xXSoyTEw7CiAgICBsb25nIGxvbmcgaW50IGE7CiAgICBpbnQgaywgbTsKICAgIGNpbiA+PiBhID4+IGs7CiAgICB3aGlsZShhKQogICAgewogICAgICAgIG0gID0gbG9nMihhKTsKICAgICAgICBxLnB1c2gobSk7CiAgICAgICAgYSAtPSBwb3dlclttXTsKICAgICAgICBrLS07CiAgICB9CiAgICB3aGlsZShrKQogICAgewogICAgICAgIG0gPSBxLnRvcCgpOwogICAgICAgIHEucG9wKCk7CiAgICAgICAgcS5wdXNoKG0tMSk7CiAgICAgICAgcS5wdXNoKG0tMSk7CiAgICAgICAgay0tOwogICAgfQogICAgd2hpbGUoIXEuZW1wdHkoKSkKICAgIHsKICAgICAgICBjb3V0PDxxLnRvcCgpPDwnICc7CiAgICAgICAgcS5wb3AoKTsKICAgIH0KICAgIHJldHVybiAwOwp9CgoK