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