#include <iostream>
#include <vector>
#include <string>

using namespace std;

void solve_tech4(int n, const string& s) {
    vector<int> fence1, fence2;

    for (int i = 0; i < n; ++i) {
        if (fence1.size() == fence2.size()) {
            fence1.push_back(i);
        } else {
            int target_idx = fence2.size();
            if (s[i] == s[fence1[target_idx]]) {
                fence2.push_back(i);
            } else {
                fence1.push_back(i);
            }
        }
    }

    int k = fence2.size();
    cout << k << "\n";
    for (int i = 0; i < k; ++i) cout << fence1[i] << (i == k - 1 ? "" : " ");
    cout << "\n";
    for (int i = 0; i < k; ++i) cout << fence2[i] << (i == k - 1 ? "" : " ");
    cout << "\n";
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n, g;
    if(cin >> n >> g) {
        string s;
        cin >> s;
        solve_tech4(n, s);
    }
    return 0;
}
