#include<bits/stdc++.h>
using namespace std;

struct S{
	bool value;
	int index;
};

const int P = 5;
vector<S> bits;

pair<vector<S>, vector<S>> attempt(const vector<S>& query){
	int n = query.size();
	for(int mask = 0; mask < (1 << n); mask ++){
		vector<bool> str[2];
		vector<S> ret[2];
		for(int i = 0; i < n; i ++){
			str[(mask >> i) & 1].push_back(query[i].value);
			ret[(mask >> i) & 1].push_back(query[i]);
		}
		if(str[0] == str[1]){
			return make_pair(ret[0], ret[1]);
		}
	}
	return make_pair(vector<S>(), vector<S>());
}

int main(){
	int n, g; cin >> n >> g;
	string t; cin >> t;
	bits.resize(n);
	for(int i = 0; i < n; i ++){
		bits[i].value = t[i] - '0';
		bits[i].index = i;
	}
	int idx = 0;
	vector<int> ans[2];
	while(idx < n){
		if(idx + 1 == n) break;
		if(t[idx] == t[idx + 1]){
			ans[0].push_back(idx);
			ans[1].push_back(idx + 1);
			idx += 2;
		}
		else if(n <= idx + 5){
			vector<S> query;
			for(int i = 0; i + idx < n; i ++){
				query.push_back(bits[i + idx]);
			}
			auto [one, two] = attempt(query);
			if(one.empty()) break;
			for(auto x : one) ans[0].push_back(x.index);
			for(auto x : two) ans[1].push_back(x.index);
			break;
		}
		else{
			{
				vector<S> query;
				for(int i = 0; i < 4; i ++){
					query.push_back(bits[i + idx]);
				}
				auto [one, two] = attempt(query);
				if(!one.empty()){
					for(auto x : one) ans[0].push_back(x.index);
					for(auto x : two) ans[1].push_back(x.index);
					idx += 4;
					continue;
				}
			}
			{
				pair<int, pair<vector<S>, vector<S>>> best;
				for(int mask = 0; mask < (1 << P); mask ++){
					vector<S> query;
					for(int i = 0; i < P; i ++){
						if((mask >> i) & 1) continue;
						query.push_back(bits[i + idx]);
					}
					auto [one, two] = attempt(query);
					int new_size = static_cast<int>(one.size() + two.size());
					if(best.first < new_size){
						best = make_pair(new_size, make_pair(one, two));
					}
				}
				auto [one, two] = best.second;
				for(auto x : one) ans[0].push_back(x.index);
				for(auto x : two) ans[1].push_back(x.index);
				idx += 5;
			}
		}
	}
	cout << ans[0].size() << endl;
	for(auto x : ans[0]){
		cout << x << " ";
	} cout << endl;
	for(auto x : ans[1]){
		cout << x << " ";
	} cout << endl;
}
