#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> ans;
  int ct = 0;
  for (int i = int(0); i <= int(n - 1); i++) {
    if (s[i] == 'W') ct++;
  }
  int ct2 = n - ct;
  if (ct % 2 && ct2 % 2) {
    cout << -1;
    return 0;
  }
  if (ct % 2 == 0) {
    for (int i = int(0); i <= int(n - 2); i++) {
      if (s[i] == 'W' && s[i + 1] == 'W') {
        ans.push_back(i + 1);
        s[i] = 'B';
        s[i + 1] = 'B';
      }
    }
    for (int i = int(0); i <= int(n - 1); i++) {
      if (s[i] == 'W') {
        for (int j = int(i + 1); j <= int(n - 1); j++) {
          if (s[j] == 'W') {
            ans.push_back(j);
            s[j] = 'B';
            s[j - 1] = 'B';
            break;
          }
          ans.push_back(j);
          swap(s[j - 1], s[j]);
        }
      }
    }
  } else {
    for (int i = int(0); i <= int(n - 2); i++) {
      if (s[i] == 'B' && s[i + 1] == 'B') {
        ans.push_back(i + 1);
        s[i] = 'W';
        s[i + 1] = 'W';
      }
    }
    for (int i = int(0); i <= int(n - 1); i++) {
      if (s[i] == 'B') {
        for (int j = int(i + 1); j <= int(n - 1); j++) {
          if (s[j] == 'B') {
            ans.push_back(j);
            s[j] = 'W';
            s[j - 1] = 'W';
            break;
          }
          ans.push_back(j);
          swap(s[j - 1], s[j]);
        }
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it << " ";
}
