#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string st, st1;
  cin >> st;
  st1 = st;
  vector<long long int> ve, ve1;
  for (int i = 1; i < n; i++) {
    if (st[i] == 'W') {
      if (st[i - 1] != st[i]) {
        ve.push_back(i);
        swap(st[i], st[i - 1]);
      }
    } else {
      if (st[i] == st[i - 1]) {
        ve.push_back(i);
        st[i] = 'W';
        st[i - 1] = 'W';
      }
    }
  }
  for (int i = 1; i < n; i++) {
    if (st1[i] == 'B') {
      if (st1[i - 1] != st1[i]) {
        ve1.push_back(i);
        swap(st1[i], st1[i - 1]);
      }
    } else {
      if (st1[i] == st1[i - 1]) {
        ve1.push_back(i);
        st1[i] = 'B';
        st1[i - 1] = 'B';
      }
    }
  }
  long long int ck = 1;
  for (int i = 1; i < n; i++) {
    if (st[i] != st[i - 1]) {
      ck = 2;
      for (int j = 1; j < n; j++) {
        if (st1[j] != st1[j - 1]) {
          cout << -1;
          return 0;
        }
      }
    }
  }
  if (ck == 1) {
    cout << ve.size() << endl;
    for (int i = 0; i < ve.size(); i++) cout << ve[i] << " ";
  } else {
    cout << ve1.size() << endl;
    for (int i = 0; i < ve1.size(); i++) cout << ve1[i] << " ";
  }
  return 0;
}
