#include <bits/stdc++.h>
//#define x first
#define y second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define getfiles ifstream cin("input.txt");ofstream cout("output.txt");
#define closefiles cin.close();cout.close();
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define endl "\n"
using namespace std;
struct nn{
    ll x;
    ll y=0;
};
bool cmp(nn a,nn b){
    return a.x<b.x;
}

int main()
{
    fast_io;
    ll n;
    cin>>n;
    string a;
    cin>>a;
    vector<ll>ans;
    vector<ll>ans1;
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
        cout<<0;
        return 0;
    }
    if(a=="BWB" || a=="WBW"){
        cout<<2<<endl;
        cout<<2<<" "<<1;
        return 0;
    }
    string o_b=a,o_w=a;
    for(int i=1;i<a.length();i++){
        if(o_b[i]=='W' && o_b[i-1]=='W'){
            o_b[i]='B';
            ans1.push_back(i);
            o_b[i-1]='B';
        }
        else  if(o_w[i]=='B' && o_w[i-1]=='B'){
            o_w[i]='W';
            o_w[i-1]='W';
            ans.push_back(i);
        }

    }
    if(o_b.find('W')==string::npos){
        cout<<ans1.size()<<endl;
        for(int j=0;j<ans1.size();j++){
            cout<<ans1[j]<<" ";
        }
        return 0;
    }
    else if(o_w.find('B')==string::npos){
        cout<<ans.size()<<endl;
        for(int j=0;j<ans.size();j++){
            cout<<ans[j]<<" ";
        }
        return 0;
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include <bits/stdc++.h>
//#define x first
#define y second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define getfiles ifstream cin("input.txt");ofstream cout("output.txt");
#define closefiles cin.close();cout.close();
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define endl "\n"
using namespace std;
struct nn{
    ll x;
    ll y=0;
};
bool cmp(nn a,nn b){
    return a.x<b.x;
}

int main()
{
    fast_io;
    ll n;
    cin>>n;
    string a;
    cin>>a;
    vector<ll>ans;
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
        cout<<0;
    }
    if(a=="BWB" || a=="WBW"){
        cout<<2<<endl;
        cout<<2<<" "<<1;
        return 0;
    }
    for(int i=1;i<n;i++){
        if(a[i]=='W' && a[i-1]=='W'){
            ans.push_back(i);
            a[i-1]='B';
            a[i]='B';
        }
    }
    for(int i=1;i<n;i++){
        if(a[i]=='B' && a[i-1]=='B'){
            ans.push_back(i);
            a[i-1]='W';
            a[i]='W';
            i++;
        }
    }
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
            cout<<ans.size()<<endl;
            for(ll i=0;i<ans.size();i++){
                cout<<ans[i]<<" ";
            }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include <bits/stdc++.h>
//#define x first
#define y second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define getfiles ifstream cin("input.txt");ofstream cout("output.txt");
#define closefiles cin.close();cout.close();
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define endl "\n"
using namespace std;
struct nn{
    ll x;
    ll y=0;
};
bool cmp(nn a,nn b){
    return a.x<b.x;
}

int main()
{
    fast_io;
    ll n;
    cin>>n;
    string a;
    cin>>a;
    vector<ll>ans;
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
        cout<<0;
        return 0;
    }
    if(a=="BWB" || a=="WBW"){
        cout<<2<<endl;
        cout<<2<<" "<<1;
        return 0;
    }
    for(int i=1;i<n;i++){
        if(a[i]=='W' && a[i-1]=='W'){
            ans.push_back(i);
            a[i-1]='B';
            a[i]='B';
        }
    }
    for(int i=1;i<n;i++){
        if(a[i]=='B' && a[i-1]=='B'){
            ans.push_back(i);
            a[i-1]='W';
            a[i]='W';
            i++;
        }
    }
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
            cout<<ans.size()<<endl;
            for(ll i=0;i<ans.size();i++){
                cout<<ans[i]<<" ";
            }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include <bits/stdc++.h>
//#define x first
#define y second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define getfiles ifstream cin("input.txt");ofstream cout("output.txt");
#define closefiles cin.close();cout.close();
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define endl "\n"
using namespace std;
struct nn{
    ll x;
    ll y=0;
};
bool cmp(nn a,nn b){
    return a.x<b.x;
}

int main()
{
    fast_io;
    ll n;
    cin>>n;
    string a;
    cin>>a;
    vector<ll>ans;
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
        cout<<0;
        return 0;
    }
    if(a=="BWB" || a=="WBW"){
        cout<<2<<endl;
        cout<<2<<" "<<1;
        return 0;
    }
    vector<ll> b;
    vector<ll> w;
    for(int i=0;i<a.length();i++){
        if(a[i]=='B'){
            b.push_back(i);
        }
        else{
            w.push_back(i);
        }
    }
    bool izm=false;
    if(b[b.size()-1]==w[0]-1){
        for(ll j=0;j<b.size()-1;j++){
            a[b[j]]='W';
            a[b[j+1]]='W';
            ans.push_back(b[j]+1);
            j++;
        }
        izm=true;
    }
    if(w[w.size()-1]==b[0]-1 && !izm){
        for(ll j=0;j<w.size()-1;j++){
            a[w[j]]='B';
            a[w[j+1]]='B';
            ans.push_back(w[j]+1);
            j++;
        }
    }
    else{
        for(ll j=0;j<b.size()-1;j++){
            if(b[j]==b[j+1]-1){
            a[b[j]]='W';
            a[b[j+1]]='W';
            ans.push_back(b[j]+1);
            j++;
            }
        }
        for(ll j=0;j<w.size()-1;j++){
            if(w[j]==w[j+1]-1){
            a[w[j]]='B';
            a[w[j+1]]='B';
            ans.push_back(w[j]+1);
            j++;
            }
        }
    }
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
            cout<<ans.size()<<endl;
            for(ll i=0;i<ans.size();i++){
                cout<<ans[i]<<" ";
            }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include <bits/stdc++.h>
//#define x first
#define y second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define getfiles ifstream cin("input.txt");ofstream cout("output.txt");
#define closefiles cin.close();cout.close();
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define endl "\n"
using namespace std;
struct nn{
    ll x;
    ll y=0;
};
bool cmp(nn a,nn b){
    return a.x<b.x;
}

int main()
{
    fast_io;
    ll n;
    cin>>n;
    string a;
    cin>>a;
    vector<ll>ans;
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
        cout<<0;
    }
    if(a=="BWB" || a=="WBW"){
        cout<<2<<endl;
        cout<<2<<" "<<1;
        return 0;
    }
    for(int i=1;i<n;i++){
        if(a[i]=='W' && a[i-1]=='W'){
            ans.push_back(i+1);
            a[i-1]='B';
            a[i]='B';
        }
    }
    for(int i=1;i<n;i++){
        if(a[i]=='B' && a[i-1]=='B'){
            ans.push_back(i+1);
            a[i-1]='W';
            a[i]='W';
            i++;
        }
    }
    if((a.find('W')==string::npos && a.find('B')!=string::npos)|| (a.find('W')!=string::npos && a.find('B')==string::npos)){
            cout<<ans.size()<<endl;
            for(ll i=0;i<ans.size();i++){
                cout<<ans[i]<<" ";
            }
    }
    else{
        cout<<-1;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    vector<int> v;
    for(int i=0;i<n-1;i++)
    {
        if(s[i]!='W')
        {
            s[i]='W';
            if(s[i+1]=='B')
            s[i+1]='W';
            else
            s[i+1]='B';
            v.push_back(i);
        }
    }
    if(s[n-1]=='B')
    cout<<-1;
    else
    {
        cout<<v.size()<<endl;
        for(int i=0;i<v.size();i++)
        cout<<v[i]+1<<" ";
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    vector<int> v;
    if(s[0]=='W')
    {for(int i=1;i<n-1;i++)
    {
        if(s[i]!='W')
        {
            s[i]='W';
            if(s[i+1]=='B')
            s[i+1]='W';
            else
            s[i+1]='B';
            v.push_back(i);
        }
    }
    if(s[n-1]=='B')
    cout<<-1;
    else
    {
        cout<<v.size()<<endl;
        for(int i=0;i<v.size();i++)
        cout<<v[i]+1<<" ";
    }}
    else
    {
       for(int i=1;i<n-1;i++)
    {
        if(s[i]!='B')
        {
            s[i]='B';
            if(s[i+1]=='B')
            s[i+1]='W';
            else
            s[i+1]='B';
            v.push_back(i);
        }
    }
    if(s[n-1]=='W')
    cout<<-1;
    else
    {
        cout<<v.size()<<endl;
        for(int i=0;i<v.size();i++)
        cout<<v[i]+1<<" ";
    }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    vector<int> v;
    for(int i=0;i<n-1;i++)
    {
        if(s[i]!='W')
        {
            s[i]='W';
            if(s[i+1]=='B')
            s[i+1]='W';
            else
            s[i+1]='B';
            v.push_back(i);
        }
    }
    if(s[n-1]=='B')
    cout<<-1;
    else
    {
        cout<<v.size()<<endl;
        for(int i=0;i<v.size();i++)
        cout<<v[i]<<" ";
    }
}


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9+7;
    const int MAKS = 202;
    char tab[MAKS];
    int main()
    {
        ios_base::sync_with_stdio(0);
        int n;
        cin >> n;
        int ilew = 0;
        int ileb = 0;
        for(int i = 1 ; i <= n; i++)
        {
            cin >> tab[i];
            if(tab[i] == 'B') ileb++;
            if(tab[i] == 'W') ilew++;
        }
        if(ileb % 2 == 1 && ilew % 2 == 1)
        {
            cout << -1;
            return 0;
        }
        bool check1 = 0;
        bool check2 = 0;
        for(int i = 1 ; i <= n; i++)
        {
            if(tab[i] != 'B') check1 = 1;
            if(tab[i] != 'W') check2 = 1;
        }
        if(check1 == 0 || check2 == 0)
        {
            cout << 0;
            return 0;
        }

        bool pier = 0;
        if(tab[1] == 'B') pier = 1;
        char pocz;
        if(pier) pocz = 'B';
        else pocz = 'W';
        int ile = 0;
        vector<int> wyn;
        for(int i = 1; i <=n-1; i++)
        {
            if(tab[i] != tab[i+1] || tab[i] != pocz)
            {
                ile++;
                wyn.push_back(i);
                swap(tab[i],tab[i+1]);
            }
        }
        pier = 0;
        if(tab[1] == 'B') pier = 1;
        if(pier == 0)
        {
            if(ilew % 2 == 0)
            {
                //cout << "ye";
                for(int i = 1; i<=ilew ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ileb; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        else
        {
            if(ileb % 2 == 0)
            {
                for(int i = 1; i<=ileb ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ilew; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        cout << ile << "\n";
        for(auto it : wyn) cout << it << " ";
        //for(int i = 1 ;i<=n; i++) cout << tab[i];

    }


            #include<bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            const int MOD = 1e9+7;
            const int MAKS = 202;
            char tab[MAKS];
            bool czy(int n)
            {
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0) return 1;
                return 0;
            }
            int main()
            {
                ios_base::sync_with_stdio(0);
                int n;
                cin >> n;
                int ilew = 0;
                int ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    cin >> tab[i];
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                if(ileb % 2 == 1 && ilew % 2 == 1)
                {
                    cout << -1;
                    return 0;
                }
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0)
                {
                    cout << 0;
                    return 0;
                }

                bool pier = 0;
                if(tab[1] == 'B') pier = 1;
                char pocz;
                if(pier) pocz = 'B';
                else pocz = 'W';
                int ile = 0;
                vector<int> wyn;
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                ilew = 0;
                ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                check1 = 0;
                check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    //cout << tab[i] << " ";
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                //cout << check2 << " ";
                if(check2 && check1)
                {
                    for(int i = 1; i <=n-1; i++)
                    {
                        if(czy(n)) break;
                        if(tab[i] != tab[1])
                        {
                            tab[i] = tab[1];
                            tab[i+1] = tab[1];
                            ile++;
                            wyn.push_back(i);
                        }
                    }
                }
                cout << ile << "\n";
                for(auto it : wyn) cout << it << " ";
                //for(int i = 1 ;i<=n; i++) cout << tab[i];

            }


        #include<bits/stdc++.h>
        using namespace std;
        typedef long long ll;
        const int MOD = 1e9+7;
        const int MAKS = 202;
        char tab[MAKS];
        bool czy(int n)
        {
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0) return 1;
            return 0;
        }
        int main()
        {
            ios_base::sync_with_stdio(0);
            int n;
            cin >> n;
            int ilew = 0;
            int ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                cin >> tab[i];
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            if(ileb % 2 == 1 && ilew % 2 == 1)
            {
                cout << -1;
                return 0;
            }
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0)
            {
                cout << 0;
                return 0;
            }

            bool pier = 0;
            if(tab[1] == 'B') pier = 1;
            char pocz;
            if(pier) pocz = 'B';
            else pocz = 'W';
            int ile = 0;
            vector<int> wyn;
            for(int i = 1; i <=n-1; i++)
            {
                if(czy(n)) break;
                if(tab[i] != tab[i+1])
                {
                    ile++;
                    wyn.push_back(i);
                    swap(tab[i],tab[i+1]);
                } else if(tab[i] != tab[1])
                {
                    tab[i] = tab[1];
                    tab[i+1] = tab[1];
                    ile++;
                    wyn.push_back(i);
                }
            }
            ilew = 0;
            ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            check1 = 0;
            check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                //cout << tab[i] << " ";
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            //cout << check2 << " ";
            if(check2 && check1)
            {
                cout << "yo";
                pier = 0;
                if(tab[1] == 'B') pier = 1;
                if(pier == 0)
                {
                    if(ilew % 2 == 0)
                    {
                        //cout << "ye";
                        for(int i = 1; i<=ilew ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ileb; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
                else
                {
                    if(ileb % 2 == 0)
                    {
                        for(int i = 1; i<=ileb ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ilew; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
            }
            cout << ile << "\n";
            for(auto it : wyn) cout << it << " ";
            //for(int i = 1 ;i<=n; i++) cout << tab[i];

        }


            #include<bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            const int MOD = 1e9+7;
            const int MAKS = 202;
            char tab[MAKS];
            bool czy(int n)
            {
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0) return 1;
                return 0;
            }
            int main()
            {
                ios_base::sync_with_stdio(0);
                int n;
                cin >> n;
                int ilew = 0;
                int ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    cin >> tab[i];
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                if(ileb % 2 == 1 && ilew % 2 == 1)
                {
                    cout << -1;
                    return 0;
                }
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0)
                {
                    cout << 0;
                    return 0;
                }

                bool pier = 0;
                if(tab[1] == 'B') pier = 1;
                char pocz;
                if(pier) pocz = 'B';
                else pocz = 'W';
                int ile = 0;
                vector<int> wyn;
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                ilew = 0;
                ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                check1 = 0;
                check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    //cout << tab[i] << " ";
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                //cout << check2 << " ";
                if(check2 && check1)
                {
                    for(int i = 1; i <=n-1; i++)
                    {
                        if(czy(n)) break;
                        if(tab[i] != tab[1])
                        {
                            tab[i] = tab[1];
                            tab[i+1] = tab[1];
                            ile++;
                            wyn.push_back(i);
                        }
                    }
                }
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                cout << ile << "\n";
                for(auto it : wyn) cout << it << " ";
                //for(int i = 1 ;i<=n; i++) cout << tab[i];

            }


        #include<bits/stdc++.h>
        using namespace std;
        typedef long long ll;
        const int MOD = 1e9+7;
        const int MAKS = 202;
        char tab[MAKS];
        bool czy(int n)
        {
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0) return 1;
            return 0;
        }
        int main()
        {
            ios_base::sync_with_stdio(0);
            int n;
            cin >> n;
            int ilew = 0;
            int ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                cin >> tab[i];
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            if(ileb % 2 == 1 && ilew % 2 == 1)
            {
                cout << -1;
                return 0;
            }
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0)
            {
                cout << 0;
                return 0;
            }

            bool pier = 0;
            if(tab[1] == 'B') pier = 1;
            char pocz;
            if(pier) pocz = 'B';
            else pocz = 'W';
            int ile = 0;
            vector<int> wyn;
            for(int i = 1; i <=n-1; i++)
            {
                if(czy(n)) break;
                if(tab[i] != tab[i+1])
                {
                    //cout << tab[1] << " ";
                    ile++;
                    wyn.push_back(i);
                    swap(tab[i],tab[i+1]);
                }
                if(tab[i] != tab[1])
                {
                    tab[i] = tab[1];
                    tab[i+1] = tab[1];
                    ile++;
                    wyn.push_back(i);
                }
            }
            ilew = 0;
            ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            check1 = 0;
            check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                //cout << tab[i] << " ";
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            //cout << check2 << " ";
            if(check2 && check1)
            {
                cout << "yo";
                pier = 0;
                if(tab[1] == 'B') pier = 1;
                if(pier == 0)
                {
                    if(ilew % 2 == 0)
                    {
                        //cout << "ye";
                        for(int i = 1; i<=ilew ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ileb; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
                else
                {
                    if(ileb % 2 == 0)
                    {
                        for(int i = 1; i<=ileb ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ilew; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
            }
            cout << ile << "\n";
            for(auto it : wyn) cout << it << " ";
            //for(int i = 1 ;i<=n; i++) cout << tab[i];

        }


        #include<bits/stdc++.h>
        using namespace std;
        typedef long long ll;
        const int MOD = 1e9+7;
        const int MAKS = 202;
        char tab[MAKS];
        int main()
        {
            ios_base::sync_with_stdio(0);
            int n;
            cin >> n;
            int ilew = 0;
            int ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                cin >> tab[i];
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            if(ileb % 2 == 1 && ilew % 2 == 1)
            {
                cout << -1;
                return 0;
            }
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0)
            {
                cout << 0;
                return 0;
            }

            bool pier = 0;
            if(tab[1] == 'B') pier = 1;
            char pocz;
            if(pier) pocz = 'B';
            else pocz = 'W';
            int ile = 0;
            vector<int> wyn;
            for(int i = 1; i <=n-1; i++)
            {
                if(tab[i] != tab[i+1])
                {
                    //cout << tab[1] << " ";
                    ile++;
                    wyn.push_back(i);
                    swap(tab[i],tab[i+1]);
                }
                if(tab[i] != tab[1])
                {
                    tab[i] = tab[1];
                    tab[i+1] = tab[1];
                    ile++;
                    wyn.push_back(i);
                }
            }
            ilew = 0;
            ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            check1 = 0;
            check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0)
            {
                pier = 0;
                if(tab[1] == 'B') pier = 1;
                if(pier == 0)
                {
                    if(ilew % 2 == 0)
                    {
                        //cout << "ye";
                        for(int i = 1; i<=ilew ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ileb; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
                else
                {
                    if(ileb % 2 == 0)
                    {
                        for(int i = 1; i<=ileb ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ilew; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
            }
            cout << ile << "\n";
            for(auto it : wyn) cout << it << " ";
            //for(int i = 1 ;i<=n; i++) cout << tab[i];

        }


#include<bits/stdc++.h>
using namespace std;
char tab[300];
vector<int> wyn;
int main()
{
    int n; cin >> n;
    for(int i = 1 ; i<=n; i++)
    {
        cin >> tab[i];
    }
    int ile = 0;
    if(tab[1] == 'B')
    {
        ile++;
        tab[1] = 'W';
        if(tab[2] == 'B') tab[2] = 'W';
        else tab[2] = 'B';
        wyn.push_back(1);
    }
    for(int i = 2; i<=n-1; i++)
    {
        if(tab[i] == 'B')
        {
            ile++;
            wyn.push_back(i);
            tab[i] = 'W';
            if(tab[i+1] == 'B') tab[i+1] = 'W';
            else tab[i+1] = 'B';
        }
    }
    if(tab[n] == 'W')
    {
        cout << ile << "\n";
        for(auto it: wyn) cout << it << " ";
        return 0;
    }
    if(tab[1] == 'W')
    {
        ile++;
        tab[1] = 'B';
        if(tab[2] == 'W') tab[2] = 'B';
        else tab[2] = 'W';
        wyn.push_back(1);
    }
    for(int i = 2; i<=n-1; i++)
    {
        if(tab[i] == 'W')
        {
            ile++;
            wyn.push_back(i);
            tab[i] = 'B';
            if(tab[i+1] == 'W') tab[i+1] = 'B';
            else tab[i+1] = 'W';
        }
    }
    if(tab[n] == 'B')
    {
        cout << ile << "\n";
        for(auto it: wyn) cout << it << " ";
    } else cout << -1;
}


            #include<bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            const int MOD = 1e9+7;
            const int MAKS = 202;
            char tab[MAKS];
            bool czy(int n)
            {
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0) return 1;
                return 0;
            }
            int main()
            {
                ios_base::sync_with_stdio(0);
                int n;
                cin >> n;
                int ilew = 0;
                int ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    cin >> tab[i];
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                if(ileb % 2 == 1 && ilew % 2 == 1)
                {
                    cout << -1;
                    return 0;
                }
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0)
                {
                    cout << 0;
                    return 0;
                }

                bool pier = 0;
                if(tab[1] == 'B') pier = 1;
                char pocz;
                if(pier) pocz = 'B';
                else pocz = 'W';
                int ile = 0;
                vector<int> wyn;
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                ilew = 0;
                ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                check1 = 0;
                check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    //cout << tab[i] << " ";
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                //cout << check2 << " ";
                if(check2 && check1)
                {
                    //cout << "yo";
                    pier = 0;
                    if(tab[1] == 'B') pier = 1;
                    if(pier == 0)
                    {
                        if(ilew % 2 == 0)
                        {
                            //cout << "ye";
                            for(int i = 1; i<=ilew ; i+=2)
                            {
                                wyn.push_back(i);
                                ile++;
                            }
                        } else
                        {
                            for(int i = n ; i>=ileb; i-=2)
                            {
                                ile++;
                                wyn.push_back(i-1);
                            }
                        }
                    }
                    else
                    {
                        if(ileb % 2 == 0)
                        {
                            for(int i = 1; i<=ileb ; i+=2)
                            {
                                wyn.push_back(i);
                                ile++;
                            }
                        } else
                        {
                            for(int i = n ; i>=ilew; i-=2)
                            {
                                ile++;
                                wyn.push_back(i-1);
                            }
                        }
                    }
                }
                cout << ile << "\n";
                for(auto it : wyn) cout << it << " ";
                //for(int i = 1 ;i<=n; i++) cout << tab[i];

            }


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9+7;
    const int MAKS = 202;
    char tab[MAKS];
    int main()
    {
        ios_base::sync_with_stdio(0);
        int n;
        cin >> n;
        int ilew = 0;
        int ileb = 0;
        for(int i = 1 ; i <= n; i++)
        {
            cin >> tab[i];
            if(tab[i] == 'B') ileb++;
            if(tab[i] == 'W') ilew++;
        }
        if(ileb % 2 == 1 && ilew % 2 == 1)
        {
            cout << -1;
            return 0;
        }
        bool check1 = 0;
        bool check2 = 0;
        for(int i = 1 ; i <= n; i++)
        {
            if(tab[i] != 'B') check1 = 1;
            if(tab[i] != 'W') check2 = 1;
        }
        if(check1 == 0 || check2 == 0)
        {
            cout << 0;
            return 0;
        }
        int ile = 0;
        vector<int> wyn;
        for(int i = 1; i <=n-1; i++)
        {
            if(tab[i] != tab[i+1])
            {
                ile++;
                wyn.push_back(i);
                swap(tab[i],tab[i+1]);
            }
        }
        bool pier = 0;
        if(tab[1] == 'B') pier = 1;
        if(pier == 0)
        {
            if(ilew % 2 == 0)
            {
                for(int i = 1; i<=ilew ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ileb; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        else
        {
            if(ileb % 2 == 0)
            {
                for(int i = 1; i<=ileb ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ilew; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        cout << ile << "\n";
        for(auto it : wyn) cout << it << " ";
        //for(int i = 1 ; i<=n ;i++) cout << tab[i];

    }


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9+7;
    const int MAKS = 202;
    char tab[MAKS];
    int main()
    {
        ios_base::sync_with_stdio(0);
        int n;
        cin >> n;
        for(int i = 1 ; i <= n; i++)
        {
            cin >> tab[i];
        }
        int ile = 0;
        vector<int> wyn;
        for(int i = 1; i <=n-1; i++)
        {
            if(tab[i] != tab[i+1])
            {
                ile++;
                wyn.push_back(i);
                swap(tab[i],tab[i+1]);
            }
        }
        int ilew = 0;
        int ileb = 0;
        int gdziew = 0;
        int gdzieb = 0;
        bool ktory = 0; // 0-B 1-W
        if(tab[1] == 'W') ktory = 1;
        for(int i = 1 ; i<=n; i++)
        {
            if(tab[i] == 'B')
            {
                ileb++;
                gdzieb = i;
            }
            if(tab[i] == 'W')
            {
                ilew++;
                gdziew = i;
            }
        }
        if(ilew % 2 == 1 && ileb % 2 == 1)
        {
            cout << "-1";
            return 0;
        }
        bool check = 0;
        for(int i = 1 ; i<=n; i++)
        {
            if(tab[i] != 'W') check = 1;
        }
        if(check == 0)
        {
            cout << 0;
            return 0;
        }
        check = 0;
        for(int i = 1; i<=n; i++)
        {
            if(tab[i] != 'B') check = 1;
        }
        if(check == 0)
        {
            cout << 0;
            return 0;
        }
        if(ilew % 2 == 0)
        {
            ilew = 0;
            if(ktory == 1)
            {
                for(int i = 1; i<=n; i+=2)
                {
                    if(tab[i] == 'W')
                    {
                        wyn.push_back(i);
                        ilew++;
                    }
                }
            } else
            {
                for(int i = n; i>=1 ; i-=2)
                {
                    if(tab[i] == 'W')
                    {
                        wyn.push_back(i-1);
                        ilew++;
                    }
                }
            }
            ile += ilew;
        } else
        {
            //cout << "yo";
            ileb = 0;
            if(ktory == 0)
            {
                for(int i = 1; i<=n; i+=2)
                {
                    if(tab[i] == 'B')
                    {
                        wyn.push_back(i);
                        ileb++;
                    }
                }
            } else
            {
                for(int i = n ; i>=1; i-=2)
                {
                    if(tab[i] == 'B')
                    {
                        wyn.push_back(i-1);
                        ileb++;
                    }
                }
            }
            ile += ileb;
        }
        cout << ile << "\n";
        for(auto it: wyn)
        {
            cout << it << " ";
        }
        //for(int i = 1 ; i<=n; i++) cout << tab[i];
    }


        #include<bits/stdc++.h>
        using namespace std;
        typedef long long ll;
        const int MOD = 1e9+7;
        const int MAKS = 202;
        char tab[MAKS];
        int main()
        {
            ios_base::sync_with_stdio(0);
            int n;
            cin >> n;
            int ilew = 0;
            int ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                cin >> tab[i];
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            if(ileb % 2 == 1 && ilew % 2 == 1)
            {
                cout << -1;
                return 0;
            }
            bool check1 = 0;
            bool check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            if(check1 == 0 || check2 == 0)
            {
                cout << 0;
                return 0;
            }

            bool pier = 0;
            if(tab[1] == 'B') pier = 1;
            char pocz;
            if(pier) pocz = 'B';
            else pocz = 'W';
            int ile = 0;
            vector<int> wyn;
            for(int i = 1; i <=n-1; i++)
            {
                if(tab[i] != tab[i+1])
                {
                    //cout << tab[1] << " ";
                    ile++;
                    wyn.push_back(i);
                    swap(tab[i],tab[i+1]);
                }
                if(tab[i] != tab[1])
                {
                    tab[i] = tab[1];
                    tab[i+1] = tab[1];
                    ile++;
                    wyn.push_back(i);
                }
            }
            ilew = 0;
            ileb = 0;
            for(int i = 1 ; i <= n; i++)
            {
                if(tab[i] == 'B') ileb++;
                if(tab[i] == 'W') ilew++;
            }
            check1 = 0;
            check2 = 0;
            for(int i = 1 ; i <= n; i++)
            {
                //cout << tab[i] << " ";
                if(tab[i] != 'B') check1 = 1;
                if(tab[i] != 'W') check2 = 1;
            }
            //cout << check2 << " ";
            if(check2 && check1)
            {
                cout << "yo";
                pier = 0;
                if(tab[1] == 'B') pier = 1;
                if(pier == 0)
                {
                    if(ilew % 2 == 0)
                    {
                        //cout << "ye";
                        for(int i = 1; i<=ilew ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ileb; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
                else
                {
                    if(ileb % 2 == 0)
                    {
                        for(int i = 1; i<=ileb ; i+=2)
                        {
                            wyn.push_back(i);
                            ile++;
                        }
                    } else
                    {
                        for(int i = n ; i>=ilew; i-=2)
                        {
                            ile++;
                            wyn.push_back(i-1);
                        }
                    }
                }
            }
            cout << ile << "\n";
            for(auto it : wyn) cout << it << " ";
            //for(int i = 1 ;i<=n; i++) cout << tab[i];

        }


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9+7;
    const int MAKS = 202;
    char tab[MAKS];
    int main()
    {
        ios_base::sync_with_stdio(0);
        int n;
        cin >> n;
        int ilew = 0;
        int ileb = 0;
        for(int i = 1 ; i <= n; i++)
        {
            cin >> tab[i];
            if(tab[i] == 'B') ileb++;
            if(tab[i] == 'W') ilew++;
        }
        if(ileb % 2 == 1 && ilew % 2 == 1)
        {
            cout << -1;
            return 0;
        }
        bool check1 = 0;
        bool check2 = 0;
        for(int i = 1 ; i <= n; i++)
        {
            if(tab[i] != 'B') check1 = 1;
            if(tab[i] != 'W') check2 = 1;
        }
        if(check1 == 0 || check2 == 0)
        {
            cout << 0;
            return 0;
        }

        bool pier = 0;
        if(tab[1] == 'B') pier = 1;
        char pocz;
        if(pier) pocz = 'B';
        else pocz = 'W';
        int ile = 0;
        vector<int> wyn;
        for(int i = 1; i <=n-1; i++)
        {
            if(tab[i] != tab[i+1])
            {
                //cout << tab[1] << " ";
                ile++;
                wyn.push_back(i);
                swap(tab[i],tab[i+1]);
            }
            if(tab[i] != tab[1])
            {
                tab[i] = tab[1];
                tab[i+1] = tab[1];
            }
        }
        pier = 0;
        if(tab[1] == 'B') pier = 1;
        if(pier == 0)
        {
            if(ilew % 2 == 0)
            {
                //cout << "ye";
                for(int i = 1; i<=ilew ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ileb; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        else
        {
            if(ileb % 2 == 0)
            {
                for(int i = 1; i<=ileb ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ilew; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        cout << ile << "\n";
        for(auto it : wyn) cout << it << " ";
        //for(int i = 1 ;i<=n; i++) cout << tab[i];

    }


            #include<bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            const int MOD = 1e9+7;
            const int MAKS = 202;
            char tab[MAKS];
            bool czy(int n)
            {
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0) return 1;
                return 0;
            }
            int main()
            {
                ios_base::sync_with_stdio(0);
                int n;
                cin >> n;
                int ilew = 0;
                int ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    cin >> tab[i];
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                if(ileb % 2 == 1 && ilew % 2 == 1)
                {
                    cout << -1;
                    return 0;
                }
                bool check1 = 0;
                bool check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                if(check1 == 0 || check2 == 0)
                {
                    cout << 0;
                    return 0;
                }

                bool pier = 0;
                if(tab[1] == 'B') pier = 1;
                char pocz;
                if(pier) pocz = 'B';
                else pocz = 'W';
                int ile = 0;
                vector<int> wyn;
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                ilew = 0;
                ileb = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    if(tab[i] == 'B') ileb++;
                    if(tab[i] == 'W') ilew++;
                }
                check1 = 0;
                check2 = 0;
                for(int i = 1 ; i <= n; i++)
                {
                    //cout << tab[i] << " ";
                    if(tab[i] != 'B') check1 = 1;
                    if(tab[i] != 'W') check2 = 1;
                }
                //cout << check2 << " ";
                    for(int i = 1; i <=n-1; i++)
                    {
                        if(czy(n)) break;
                        if(tab[i] != tab[1])
                        {
                            tab[i] = tab[1];
                            tab[i+1] = tab[1];
                            ile++;
                            wyn.push_back(i);
                        }
                    }
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                for(int i = 1; i <=n-1; i++)
                {
                    if(czy(n)) break;
                    if(tab[i] != tab[i+1])
                    {
                        ile++;
                        wyn.push_back(i);
                        swap(tab[i],tab[i+1]);
                    } else if(tab[i] != tab[1])
                    {
                        tab[i] = tab[1];
                        tab[i+1] = tab[1];
                        ile++;
                        wyn.push_back(i);
                    }
                }
                cout << ile << "\n";
                for(auto it : wyn) cout << it << " ";
                //for(int i = 1 ;i<=n; i++) cout << tab[i];

            }


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9+7;
    const int MAKS = 202;
    char tab[MAKS];
    int main()
    {
        ios_base::sync_with_stdio(0);
        int n;
        cin >> n;
        int ilew = 0;
        int ileb = 0;
        for(int i = 1 ; i <= n; i++)
        {
            cin >> tab[i];
            if(tab[i] == 'B') ileb++;
            if(tab[i] == 'W') ilew++;
        }
        if(ileb % 2 == 1 && ilew % 2 == 1)
        {
            cout << -1;
            return 0;
        }
        bool check1 = 0;
        bool check2 = 0;
        for(int i = 1 ; i <= n; i++)
        {
            if(tab[i] != 'B') check1 = 1;
            if(tab[i] != 'W') check2 = 1;
        }
        if(check1 == 0 || check2 == 0)
        {
            cout << 0;
            return 0;
        }
        int ile = 0;
        vector<int> wyn;
        for(int i = 1; i <=n-1; i++)
        {
                ile++;
                wyn.push_back(i);
                swap(tab[i],tab[i+1]);
        }
        bool pier = 0;
        if(tab[1] == 'B') pier = 1;
        if(pier == 0)
        {
            if(ilew % 2 == 0)
            {
                for(int i = 1; i<=ilew ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ileb; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        else
        {
            if(ileb % 2 == 0)
            {
                for(int i = 1; i<=ileb ; i+=2)
                {
                    wyn.push_back(i);
                    ile++;
                }
            } else
            {
                for(int i = n ; i>=ilew; i-=2)
                {
                    ile++;
                    wyn.push_back(i-1);
                }
            }
        }
        cout << ile << "\n";
        for(auto it : wyn) cout << it << " ";

    }


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DEBUG(c) cout << "Vul Paisi " << c << endl;
vector <int> vec;
bool solve(string &s, char a, char b, int n)
{
    vec.clear();
    for(int i=1; i<n; i++)
    {
        if(i+1==n)
        {
            if(s[i]==b)
            {
                vec.clear();
                for(int j=0; j<n-1; j++)
                {
                    if(s[j]==a)
                    {
                        s[j] = b;
                        if(s[j+1]==b)
                            s[j+1] = a;
                        else
                            s[j+1] = b;
                        vec.push_back(j+1);
                    }
                }
                if(s[n-1]==b)
                    return true;
                return false;
            }
            return true;
        }
        if(s[i]==b)
        {
            s[i] = a;
            if(s[i+1]==a)
                s[i+1] = b;
            else
                s[i+1] = a;
            vec.push_back(i+1);
        }
    }
}
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(s[0]=='B')
    {
    if(solve(s, 'B', 'W', n))
    {
        //DEBUG('B');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    else if(s[0]=='W')
    {
    if(solve(s, 'W', 'B', n))
    {
        //DEBUG('W');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DEBUG(c) cout << "Vul Paisi " << c << endl;
bool miltesena(const string &s)
{
    set <char> ms = {s.begin(), s.end()};
    return ms.size()==1;
}
void vul_khujtesi(const string &s)
{
    cout << "DEKHTESI:" << endl;
    for(auto i:s)
        cout << i << " ";
    cout << endl;
}
vector <int> vec;
bool solve(string s, string k, char a, char b, int n)
{
    vec.clear();
    for(int i=1; i<n; i++)
    {
        if(i+1==n)
        {
            if(s[i]==b)
            {
                //DEBUG(s[i]);
                vec.clear();
                s = k;
                for(int j=0; j<n-1; j++)
                {
                    if(s[j]==a)
                    {
                        s[j] = b;
                        if(s[j+1]==b)
                            s[j+1] = a;
                        else
                            s[j+1] = b;
                        vec.push_back(j+1);
                    }
                }
                if(!miltesena(s))
                {
                  vul_khujtesi(s);
                }
                if(s[n-1]==b)
                    return true;
                return false;
            }
            if(!miltesena(s))
            {
               vul_khujtesi(s);
            }
            return true;
        }
        if(s[i]==b)
        {
            s[i] = a;
            if(s[i+1]==a)
                s[i+1] = b;
            else
                s[i+1] = a;
            vec.push_back(i+1);
        }
    }

}
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(s[0]=='B')
    {
    if(solve(s, s, 'B', 'W', n))
    {
        //DEBUG('B');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    else if(s[0]=='W')
    {
    if(solve(s, s, 'W', 'B', n))
    {
        //DEBUG('W');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    vector <int> v;
    int k=0;
    if(n==1)
    {
        cout << 0 << endl;
        return 0;
    }
    else if(n==2)
    {
        if(s[0]!=s[1])
            cout << -1 << endl;
        else
            cout << 0 << endl;
        return 0;
    }
    while(k<3*n)
    {
        int cx=count(s.begin(), s.end(), 'W');
        if(cx==0 || cx==n)
        {
            break;
        }
        int flag=0;
        for(int i=0; i<=n-3; i++)
        {
            if(s[i]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                v.push_back(i+1);
                k+=2;
                s[i]=s[i+2]=s[i+1];
                if(k>=3*n)
                    break;
            }
            else if(s[i+1]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                k++;
                s[i+1]=s[i+2]=s[i];
                if(k>=3*n)
                    break;
            }
        }
        if(flag)
            continue;
        else
            break;
    }
    if(k>=3*n)
    {
        cout << -1 << endl;
        return 0;
    }
    int cnt=count(s.begin(), s.end(), 'W');
    if(cnt==n || cnt==0)
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
        return 0;
    }
    else
        cout << -1 << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    vector <int> v;
    int k=0;
    if(n==1)
    {
        cout << 0 << endl;
        return 0;
    }
    else if(n==2)
    {
        if(s[0]!=s[1])
            cout << -1 << endl;
        else
            cout << 0 << endl;
        return 0;
    }
    while(k<=3*n)
    {
        int cx=count(s.begin(), s.end(), 'W');
        if(cx==0 || cx==n)
        {
            break;
        }
        int flag=0;
        for(int i=0; i<=n-3; i++)
        {
            if(s[i]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                v.push_back(i+1);
                k+=2;
                s[i]=s[i+2]=s[i+1];
                if(k>=3*n)
                    break;
            }
            else if(s[i+1]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                k++;
                s[i+1]=s[i+2]=s[i];
                if(k>=3*n)
                    break;
            }
        }
        if(flag)
            continue;
        else
            break;
    }
    int cnt=count(s.begin(), s.end(), 'W');
    if(cnt==n || cnt==0)
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
        return 0;
    }
    else
        cout << -1 << endl;
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector <int> v;
    string k=s, p=s;
    for(int i=0; i<n-1; i++)
    {
        if(s[i]=='B')
            continue;
        if(s[i]=='W' && s[i+1]=='W')
        {
            v.push_back(i+1);
            s[i] = 'B';
            s[i+1] = 'B';
        }
    }
    if(!count(s.begin(), s.end(), 'W'))
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
        return 0;
    }
    v.clear();
    for(int i=0; i<n-1; i++)
    {
        if(k[i]=='W')
            continue;
        if(k[i]=='B' && k[i+1]=='B')
        {
            v.push_back(i+1);
            k[i] = 'W';
            k[i+1] = 'W';
        }
    }
    if(!count(k.begin(), k.end(), 'B'))
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
        return 0;
    }
    v.clear();
    for(int i=0; i<n-2; i++)
    {
        if(p[i]!=p[i+1] && p[i+1]!=p[i+2])
        {
            p[i] = p[i+1];
            p[i+2] = p[i+1];
            v.push_back(i+1);
            v.push_back(i+2);
        }
    }
    if(count(p.begin(), p.end(), 'W') && count(p.begin(), p.end(), 'B'))
       cout << -1 << endl;
    else
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DEBUG(c) cout << "Vul Paisi " << c << endl;
bool miltesena(const string &s)
{
    set <char> ms = {s.begin(), s.end()};
    return ms.size()==1;
}
void vul_khujtesi(const string &s)
{
    cout << "DEKHTESI:" << endl;
    for(auto i:s)
        cout << i << " ";
    cout << endl;
}
vector <int> vec;
bool solve(string s, string k, char a, char b, int n)
{
    vec.clear();
    for(int i=1; i<n; i++)
    {
        if(i+1==n)
        {
            if(s[i]==b)
            {
                //DEBUG(s[i]);
                vec.clear();
                s = k;
                for(int j=0; j<n-1; j++)
                {
                    if(s[j]==a)
                    {
                        s[j] = b;
                        if(s[j+1]==b)
                            s[j+1] = a;
                        else
                            s[j+1] = b;
                        vec.push_back(j+1);
                    }
                }
               /*
                if(!miltesena(s))
                {
                  vul_khujtesi(s);
                }
                */
                if(s[n-1]==b)
                    return true;
                return false;
            }
            /*
            if(!miltesena(s))
            {
               vul_khujtesi(s);
            }
            */
            return true;
        }
        if(s[i]==b)
        {
            s[i] = a;
            if(s[i+1]==a)
                s[i+1] = b;
            else
                s[i+1] = a;
            vec.push_back(i+1);
        }
    }

}
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(s[0]=='B')
    {
    if(solve(s, s, 'B', 'W', n))
    {
        //DEBUG('B');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    else if(s[0]=='W')
    {
    if(solve(s, s, 'W', 'B', n))
    {
        //DEBUG('W');
        cout << vec.size() << endl;
        for(auto i:vec)
        {
            cout << i << " ";
        }
        return 0;
    }
    else
    {
        cout << -1 << endl;
        return 0;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    vector <int> v;
    int k=0;
    if(n==1)
    {
        cout << 0 << endl;
        return 0;
    }
    else if(n==2)
    {
        if(s[0]!=s[1])
            cout << -1 << endl;
        else
            cout << 0 << endl;
        return 0;
    }
    while(k<=3*n)
    {
        int cx=count(s.begin(), s.end(), 'W');
        if(cx==0 || cx==n)
        {
            break;
        }
        int flag=0;
        for(int i=0; i<=n-3; i++)
        {
            if(s[i]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                v.push_back(i+1);
                k+=2;
                s[i]=s[i+2]=s[i+1];
                if(k>=3*n)
                    break;
            }
            else if(s[i+1]==s[i+2] && s[i]!=s[i+1])
            {
                flag++;
                v.push_back(i+2);
                k++;
                s[i+1]=s[i+2]=s[i];
                if(k>=3*n)
                    break;
            }
            else if(s[i]==s[i+1] && s[i]!=s[i+2])
            {
                flag++;
                v.push_back(i+1);
                k++;
                s[i]=s[i+1]=s[i+2];
                if(k>=3*n)
                    break;
            }
        }
        if(flag)
            continue;
        else
            break;
    }
    int cnt=count(s.begin(), s.end(), 'W');
    if(cnt==n || cnt==0)
    {
        cout << v.size() << endl;
        for(auto i:v)
            cout << i << " ";
        return 0;
    }
    else
        cout << -1 << endl;
    return 0;
}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  	if(w[ w.size()/2] >= (n/2))
  	{	int bb=1;
  		rl(i, w.size()-1, 0)
  		{
  			f(j, w[i]+1, n-bb) v.pb(j);
  			bb++;
  		}
  		for( int i=1; i<=(n-w.size()-1); i+=2)
  		 v.pb(i);
  	}
  	else
  	{	int bb=0;
  		f(i, 0, w.size()-1)
  		{
  			rl(j, w[i] ,bb ) v.pb(j);
  			bb++;
  		}
  		for(int i=w.size()+1; i<=n; i+=2) v.pb(i);
  	}
  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
int n; cin>>n;
string s; cin>>s;
int nw=0, nb=0;
f(i, 0, n-1)
{
	if(s[i]=='B') nb++;
	else nw++;
}
if(nb==0 || nw==0) { cout<<s; return;}
if( (nb&1) && (nw&1)) { cout<<-1; return;}
if( (nb&1) || (nw&1))
{	char c;
	if(nb&1) c='B';
	else c='W';
	vi w;
	f(i, 0, n-1) { if(s[i]==c) w.pb(i); }
	vi v;
	f(i , 0, w.size()-1)
	{
		rl(j, w[i]+1, 2) v.pb(j);

	}
	f(i, w.size(), n-1) {v.pb(i+1); i++; };
	cout<<v.size()<<endl; printv(v);
}
else
{
	vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) continue;
		else if(s[j]==s[j+1]) { v.pb(j+1); j++; }
		else v.pb(j+1);
	}
	cout<<v.size()<<endl; printv(v);
}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if(nb==0 || nw==0) { cout<<0<<endl; return; }
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  		//printv(w);
  		rl(i, w[0], 1) v.pb(i);
  		swap(s[0], s[w[0]]);
  		for(int i=1; i<w.size(); i+=2)
  		{
  			swap(s[w[i]], s[w[i+1]-1]);
  			f(j, w[i]+1, w[i+1]) v.pb(j);
  		}
  	for(int j=1; j<n-1; j++)
	{	//qw3(s[j], s[j+1], c);
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) { v.pb(j+1); j++; }
		//else if(s[j]==c ) { continue; }
		//else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}

  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if(nb==0 || nw==0) { cout<<0<<endl; return; }
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  		//printv(w);
  	if(w[ w.size()/2] >= (n/2))
  	{	int bb=1;
  		rl(i, w.size()-1, 0)
  		{
  			f(j, w[i]+1, n-bb) v.pb(j);
  			bb++;
  		}
  		for( int i=1; i<=(n-w.size()-1); i+=2)
  		 v.pb(i);
  	}
  	else
  	{	int bb=1;
  		f(i, 0, w.size()-1)
  		{
  			rl(j, w[i] ,bb ) v.pb(j);
  			bb++;
  		}
  		for(int i=w.size()+1; i<=n; i+=2) v.pb(i);
  	}
  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
int n; cin>>n;
string s; cin>>s;
int nw=0, nb=0;
f(i, 0, n-1)
{
	if(s[i]=='B') nb++;
	else nw++;
}
if(nb==0 || nw==0) { cout<<0; return;}
if( (nb&1) && (nw&1)) { cout<<-1; return;}
if( (nb&1) || (nw&1))
{	char c;
	if(nb&1) c='B';
	else c='W';
	vi w;
	f(i, 0, n-1) { if(s[i]==c) w.pb(i); }
	vi v;
	f(i , 0, w.size()-1)
	{
		rl(j, w[i]+1, 2) v.pb(j);

	}
	f(i, w.size(), n-1) {v.pb(i+1); i++; };
	cout<<v.size()<<endl; printv(v);
}
else
{
	vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if(nb==0 || nw==0) { cout<<0<<endl; return; }
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	vi v;
  	if( (nb&1) || (nw&1) )
  	{
  		 char c; if(nb&1) c='B'; else c='W';
  		 f(i, 0, n-2)
  		 {
  		 	if(s[i]==c) continue;
  		 	else if(s[i]==s[i+1])
  		 	{
  		 		v.pb(i+1);
  		 		i++;
  		 	}
  		 	else
  		 	{
  		 		v.pb(i+1);
  		 		swap(s[i], s[i+1]);
  		 	}
  		 }
  	}
  	else
  	{
  		int c=s[0];
  		f(i, 1, n-2)
  		{
  			if(s[i]==c) continue;
  			else if(s[i]==s[i+1])
  			{
  				v.pb(i+1);
  				i++;
  			}
  			else
  			{
  				v.pb(i+1);
  				swap(s[i], s[i+1]);
  			}
  		}
  	}
  	cout<<v.size()<<endl; printv(v);
  	/*cout<<nb<<' '<<nw<<endl;
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  		printv(w);
  		rl(i, w[0], 1) v.pb(i);
  		swap(s[0], s[w[0]]);
  		for(int i=1; i<w.size(); i+=2)
  		{	if(w[i]+1==w[i+1]) continue;
  			swap(s[w[i]], s[w[i+1]-1]);
  			f(j, w[i]+1, w[i+1]) v.pb(j);
  		}
  	for(int j=1; j<n-1; j++)
	{	//qw3(s[j], s[j+1], c);
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		//else if(s[j]==c ) { continue; }
		//else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
  		//cout<<s<<endl;
  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}*/

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
int n; cin>>n;
string s; cin>>s;
int nw=0, nb=0;
f(i, 0, n-1)
{
	if(s[i]=='B') nb++;
	else nw++;
}
if(nb==0 || nw==0) { cout<<0; return;}
if( (nb&1) && (nw&1)) { cout<<-1; return;}
if( (nb&1) || (nw&1))
{	char c;
	if(nb&1) c='B';
	else c='W';
	vi w;
	f(i, 0, n-1) { if(s[i]==c) w.pb(i); }
	//printv(w);
	vi v;
	f(i , 0, w.size()-1)
	{
		rl(j, w[i], 1) v.pb(j);

	}
	f(i, w.size(), n-1) {v.pb(i+1); i++; };
	cout<<v.size()<<endl; printv(v);
}
else
{
	vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if(nb==0 || nw==0) { cout<<0<<endl; return; }
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  		//printv(w);
  		rl(i, w[0], 1) v.pb(i);
  		for(int i=1; i<w.size(); i+=2)
  		{
  			swap(s[w[i]], s[w[i+1]-1]);
  			f(j, w[i]+1, w[i+1]) v.pb(j);
  		}
  	for(int j=1; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		//else if(s[j]==c ) { continue; }
		//else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}

  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
  	int n; cin>>n; string s; cin>>s;
  	int nb=0, nw=0;
  	f(i, 0, n-1) if(s[i]=='W') nw++; else nb++;
  	if(nb==0 || nw==0) { cout<<0<<endl; return; }
  	if( (nb&1) && (nw&1) ) { cout<<-1; return; }
  	if( (nb&1) || (nw&1) )
  	{
  		char c; if(nb&1) c='B'; else c='W';
  		vi w;
  		f(i, 0, n-1) if(s[i]==c) w.pb(i);
  		vi v;
  		//printv(w);
  		rl(i, w[0], 1) v.pb(i);
  		swap(s[0], s[w[0]]);
  		for(int i=1; i<w.size(); i+=2)
  		{	if(w[i]+1==w[i+1]) continue;
  			swap(s[w[i]], s[w[i+1]-1]);
  			f(j, w[i]+1, w[i+1]) v.pb(j);
  		}
  	for(int j=1; j<n-1; j++)
	{	//qw3(s[j], s[j+1], c);
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		//else if(s[j]==c ) { continue; }
		//else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
  		//cout<<s<<endl;
  	cout<<v.size()<<endl; printv(v);

  	}
  	else
  	{
  		vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
  	}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}


// Problem : B. Blocks
// Contest : Codeforces - Codeforces Round #608 (Div. 2)
// URL : https://codeforces.com/problemset/problem/1271/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ff first
#define fs second
#define lb lower_bound
#define ub upper_bound

#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector< vi >
#define vpii vector< pii >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define rl(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define all(x) x.begin(),x.end()
#define endl '\n'
void printv(vector<int>  v){ for(int i=0;i<v.size();i++) cout<<v[i]<<' '; cout<<endl;   }
int bem(int m , int n, int mod) { int res=1; while(n){
	     			        if(n%2!=0) { res*=m; res%=mod; }
	    			        m*=m;   m%=mod;   n/=2;
			                          }
				return res;	}
int be(int a, int b) { int res=1; 	while(b){
				if(b%2!=0) res*=a;
				a*=a; b/=2;
				}
			return res;	}
void sieve(int n, vb &prime){
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
              for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             	  }
    	 }
	}

void solve()
  {
int n; cin>>n;
string s; cin>>s;
int nw=0, nb=0;
f(i, 0, n-1)
{
	if(s[i]=='B') nb++;
	else nw++;
}
if(nb==0 || nw==0) { cout<<s; return;}
if( (nb&1) && (nw&1)) { cout<<-1; return;}
if( (nb&1) || (nw&1))
{	char c;
	if(nb&1) c='B';
	else c='W';
	vi w;
	f(i, 0, n-1) { if(s[i]==c) w.pb(i); }
	vi v;
	f(i , 0, w.size()-1)
	{
		rl(j, w[i]+1, 2) v.pb(j);

	}
	f(i, w.size(), n-1) {v.pb(i+1); i++; };
	cout<<v.size()<<endl; printv(v);
}
else
{
	vi v;
	int i;
	char c=s[0];
	for( i=1; i<n; i++)
	{
		if(s[i]!=c) break;
	}
	int j;
	for(j=i; j<n-1; j++)
	{
		if(s[j]==c && s[j+1]==c) {j++; continue;}
		else if(s[j]==s[j+1]) {s[j]=c; s[j+1]=c; v.pb(j+1); j++; }
		else if(s[j]==c ) { continue; }
		else {swap(s[j], s[j+1]); v.pb(j+1);}
		//qw2(j, s);
	}
	cout<<v.size()<<endl; printv(v);
}

  }

int32_t main ()
{
//fio
int t=1;
//cin>>t;
while(t--){
	solve();
}

}