#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int numOfBlocks, j;
string block;
void invert(char s) {
  for (int i = 0; i < numOfBlocks; i++) {
    if (block[i] == s) {
      j = i + 1;
      while (block[j] != s) {
        v.push_back(j);
        block[j - 1] = block[j - 1] == 'B' ? 'W' : 'B';
        block[j] = block[j] == 'B' ? 'W' : 'B';
        j++;
      }
      v.push_back(j);
      block[j - 1] = block[j - 1] == 'B' ? 'W' : 'B';
      block[j] = block[j] == 'B' ? 'W' : 'B';
    }
  }
}
int main() {
  int white = 0, black = 0;
  cin >> numOfBlocks >> block;
  for (int i = 0; i < numOfBlocks; i++) {
    if (block[i] == 'W')
      white++;
    else
      black++;
  }
  if (white == 0 || black == 0) {
    cout << 0;
    return 0;
  }
  if (white % 2 == 0 || black % 2 == 0) {
    if (black % 2 != 0)
      invert('W');
    else
      invert('B');
    cout << v.size() << "\n";
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
  } else {
    cout << -1;
  }
  return 0;
}
