include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int n;
void update(char& c)
{
if (c == ‘W’) c = ‘B’;
else c = ‘W’;
}
bool check(string s, char c)
{
vector[HTML_REMOVED] res;
for (int i = 0; i + 1 < n; i ++ )
{
if (s[i] != c)
{
update(s[i]);
update(s[i + 1]);
res.push_back(i);
}
}
if (s.back() != s[0]) return false;
cout << res.size() << endl;
for (auto x: res) cout << x + 1 << ' ';
if (res.size()) cout << endl;
return true;
}
int main()
{
int T;
cin >> T;
while (T – )
{
string s;
cin >> n >> s;
if (!check(s, ‘W’) && !check(s, ‘B’)) puts(“-1”);
}
return 0;
}