#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, z = 0, o = 0;
  cin >> n;
  char x;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> x;
    if (x == 'B') {
      v[i] = 0;
      z++;
    }
    if (x == 'W') {
      v[i] = 1;
      o++;
    }
  }
  if (z == 0 || o == 0) {
    cout << 0;
    return 0;
  }
  if (z % 2 == 1 && o % 2 == 1) {
    cout << -1;
    return 0;
  }
  long long to, steps = 0;
  z % 2 == 0 ? to = 0 : to = 1;
  vector<long long> mov;
  long long flag = 1;
  while (flag) {
    flag = 0;
    for (long long i = 1; i < v.size(); i++) {
      if (v[i] != v[i - 1]) {
        swap(v[i], v[i - 1]);
        steps++;
        flag = 1;
        mov.push_back(i);
      } else {
        i++;
      }
    }
  }
  for (long long i = 0; i < v.size(); i++) {
    if (v[i] == to) {
      v[i] == 0 ? v[i] = 1 : v[i] = 0;
      v[i + 1] = v[i];
      steps++;
      mov.push_back(i + 1);
      i++;
    }
  }
  cout << steps << endl;
  for (auto x : mov) {
    cout << x << " ";
  }
}
