#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
char change(char c) {
  if (c == 'B')
    return 'W';
  else
    return 'B';
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> op;
  for (long long i = 1; i < n - 1; i++) {
    if (s[i] == s[i - 1]) continue;
    s[i] = change(s[i]);
    s[i + 1] = change(s[i + 1]);
    op.push_back(i + 1);
  }
  if (s[n - 1] == s[n - 2]) {
    cout << op.size() << '\n';
    for (long long x : op) cout << x << ' ';
    cout << '\n';
    return 0;
  }
  for (long long i = n - 2; i > 0; i--) {
    if (s[i] == s[i + 1]) continue;
    s[i] = change(s[i]);
    s[i - 1] = change(s[i - 1]);
    op.push_back(i);
  }
  if (s[0] != s[1]) {
    cout << "-1\n";
    return 0;
  }
  cout << op.size() << "\n";
  for (long long x : op) cout << x << ' ';
  cout << '\n';
}
