#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long int> a1(n, 0);
  vector<long long int> a2(n, 0);
  for (long long int i = 0; i < n; i++) {
    if (s[i] == 'B')
      a1[i] = -1;
    else
      a1[i] = 1;
  }
  a2 = a1;
  vector<long long int> v1;
  vector<long long int> v2;
  for (long long int i = 0; i < n - 1; i++) {
    if (a1[i] == -1) {
      a1[i + 1] *= -1;
      v1.push_back(i);
    }
    if (a2[i] == 1) {
      a2[i + 1] *= -1;
      v2.push_back(i);
    }
  }
  if (a1[n - 1] == -1 && a2[n - 1] == 1)
    cout << -1;
  else {
    if (a1[n - 1] != -1) {
      cout << v1.size() << endl;
      for (long long int i = 0; i < v1.size(); i++) cout << v1[i] + 1 << " ";
    } else {
      cout << v2.size() << endl;
      for (long long int i = 0; i < v2.size(); i++) cout << v2[i] + 1 << " ";
    }
  }
  return 0;
}
