#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string second;
  cin >> n >> second;
  string t = second;
  bool ok = 1;
  vector<int> vec;
  for (int i = 0; i < n; i++) {
    if (second[i] == 'W') continue;
    if (i + 1 < n && second[i + 1] == second[i]) {
      vec.push_back(i);
      second[i] = second[i + 1] = 'W';
      continue;
    }
    bool foo = 1;
    int to = -1;
    for (int j = i + 1; j < n; j++)
      if (second[j] == second[i]) {
        to = j;
        break;
      }
    for (int j = i + 1; j < to; j++)
      if (second[j] == second[i]) foo = 0;
    if (to == -1) foo = 0;
    if (foo) {
      for (int j = i; j < to; j++) {
        vec.push_back(j);
        second[j] = 'W';
      }
      second[to] = 'W';
      continue;
    }
    ok = 0;
    break;
  }
  if (ok) {
    cout << (int)vec.size() << endl;
    for (auto i : vec) cout << i + 1 << " ";
    cout << endl;
    return 0;
  }
  ok = 1;
  vec.clear();
  second = t;
  for (int i = 0; i < n; i++) {
    if (second[i] == 'B') continue;
    if (i + 1 < n && second[i + 1] == second[i]) {
      vec.push_back(i);
      second[i] = second[i + 1] = 'B';
      continue;
    }
    bool foo = 1;
    int to = -1;
    for (int j = i + 1; j < n; j++)
      if (second[j] == second[i]) {
        to = j;
        break;
      }
    for (int j = i + 1; j < to; j++)
      if (second[j] == second[i]) foo = 0;
    if (to == -1) foo = 0;
    if (foo) {
      for (int j = i; j < to; j++) {
        vec.push_back(j);
        second[j] = 'B';
      }
      second[to] = 'B';
      continue;
    }
    ok = 0;
    break;
  }
  if (ok) {
    cout << (int)vec.size() << endl;
    for (auto i : vec) cout << i + 1 << " ";
    cout << endl;
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
