#include<bits/stdc++.h>
using namespace std;
int n, k;
string s;
priority_queue<int> q;
signed main(){
cin >> n >> k;
cin >> s;
s += '0';
int cnt = 0;
for(int i = 0; i <= n; i++)
{
if(s[i] == '0')
{
if(cnt != 0)
{
q.push(cnt);
cout << cnt << ' ';
}
cnt = 0;
}
else
{
cnt++;
}
}
cout << '\n';
int l = 0, r = n, mid, h, ans = n + 100;
int x;
priority_queue<int> q1;
while(l <= r)
{
mid = (l + r) / 2;
q1 = q;
for(int i = 1; i <= mid; i++)
{
if(q1.empty() or q1.top() == 1)
{
break;
}
x = q1.top();
q1.pop();
if(x % 2 == 1)
{
q1.push(x / 2);
q1.push(x / 2);
}
else
{
if(x > 2)
{
q1.push(x / 2 - 1);
}
q1.push(x / 2);
}
}
h = 0;
cout << mid << '\n';
while(!q1.empty())
{
x = q1.top();
q1.pop();
cout << x << ' ';
h += x * (x + 1) / 2;
}
cout << '\n';
if(h <= k)
{
ans = min(ans, mid);
r = mid - 1;
}
else
{
l = mid + 1;
}
}
cout << ans;
return 0;
}