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

using namespace std;

void solve_tech3(int n, const string& s) {
    vector<int> fence1, fence2;
    int i = 0;
    vector<int> square_lens = {2, 4, 6, 8, 10};

    while (i < n) {
        bool found = false;
        for (int len : square_lens) {
            if (i + len <= n) {
                int half = len / 2;
                bool match = true;
                for (int j = 0; j < half; ++j) {
                    if (s[i + j] != s[i + half + j]) {
                        match = false; break;
                    }
                }
                if (match) {
                    for(int j = 0; j < half; ++j) fence1.push_back(i + j);
                    for(int j = 0; j < half; ++j) fence2.push_back(i + half + j);
                    i += len;
                    found = true;
                    break;
                }
            }
        }
        if (!found) i++; // Пропускаме една буква
    }

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

int main(){
	int n, g; cin >> n >> g;
	string s;
	solve_tech3(n, s); 
}
