#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> ans;
  long long int n, cw, i;
  char re;
  string s;
  cin >> n;
  cin >> s;
  cw = count(s.begin(), s.end(), 'W');
  if (cw == 0 || cw == n)
    cout << "0";
  else {
    re = s[n - 1];
    for (i = n - 2; i > 0; i--) {
      if (s[i] != re) {
        s[i] = re;
        s[i - 1] = s[i - 1] == 'W' ? 'B' : 'W';
        ans.push_back(i - 1);
      }
    }
    if (s[0] == s[n - 1]) {
      cout << ans.size() << endl;
      for (auto x : ans) cout << (x + 1) << " ";
    } else {
      if (n % 2 == 1) {
        for (i = 1; i < n; i += 2) ans.push_back(i);
        cout << ans.size() << endl;
        for (auto x : ans) cout << (x + 1) << " ";
      } else
        cout << "-1";
    }
  }
}
