#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long ans, sum, tot, cnt, mx, mn, idx, chk, rem, ret, tmp, mid, lft, rgt,
      pos;
  long long tc, n, m, a, b, c, d, g, h, l, r, x, y, i, j, k;
  cin >> n;
  string s;
  cin >> s;
  long long w;
  w = b = 0;
  for (i = 0; i < n; ++i) {
    if (s[i] == 66)
      b++;
    else
      w++;
  }
  if (b & 1 && w & 1) {
    cout << -1 << endl;
    return 0;
  }
  if (b == 0 || w == 0) {
    cout << 0 << endl;
    return 0;
  }
  vector<long long> v;
  char cc;
  if (b % 2 == 0 && w % 2 == 0)
    cc = s[0];
  else if (b & 1)
    cc = 'B';
  else
    cc = 'W';
  for (i = 0; i < n; ++i) {
    if (s[i] != cc) {
      swap(s[i], s[i + 1]);
      v.push_back(i + 1);
    }
    if (s[i] == s[i + 1]) i++;
  }
  cout << v.size() << endl;
  for (auto it : v) cout << it << ' ';
  return 0;
}
