There are n blocks arranged in a row and numbered from left to right, starting from one. Each block is either black or white. 

You may perform the following operation zero or more times: choose two adjacent blocks and invert their colors (white block becomes black, and vice versa). 

You want to find a sequence of operations, such that they make all the blocks having the same color. You don't have to minimize the number of operations, but it should not exceed 3 ⋅ n. If it is impossible to find such a sequence of operations, you need to report it.

Input

The first line contains one integer n (2 ≤ n ≤ 200) — the number of blocks.

The second line contains one string s consisting of n characters, each character is either "W" or "B". If the i-th character is "W", then the i-th block is white. If the i-th character is "B", then the i-th block is black. 

Output

If it is impossible to make all the blocks having the same color, print -1.

Otherwise, print an integer k (0 ≤ k ≤ 3 ⋅ n) — the number of operations. Then print k integers p_1, p_2, ..., p_k (1 ≤ p_j ≤ n - 1), where p_j is the position of the left block in the pair of blocks that should be affected by the j-th operation.

If there are multiple answers, print any of them.

Examples

Input


8
BWWWWWWB


Output


3
6 2 4


Input


4
BWBB


Output


-1


Input


5
WWWWW


Output


0


Input


3
BWB


Output


2
2 1 

Note

In the first example, it is possible to make all blocks black in 3 operations. Start with changing blocks 6 and 7, so the sequence is "BWWWWBBB". Then change blocks 2 and 3, so the sequence is "BBBWWBB". And finally, change blocks 4 and 5, so all blocks are black.

It is impossible to make all colors equal in the second example.

All blocks are already white in the third example.

In the fourth example it is possible to make all blocks white in two operations: first operation is to change blocks 2 and 3 (so the sequence is "BBW"), and then change blocks 1 and 2 (so all blocks are white).

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Greedy algorithms


Solutions:
n = int(input())
s = list(input())
s.append('B')
b = s.count('B')
w = len(s) - b
if b == 1 or w == 0:
	print(0)
	exit(0)
s.pop(n)
b -= 1
if b % 2 and w % 2:
	print('-1')
	exit(0)
if b % 2 == 0:
	p = []
	for i in range(s.index('B'), n - 1):
		if s[i] == 'W':
			continue
		if s[i + 1:].count('B') == 0:
			break
		p.append(i + 1)
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
	print(len(p))
	print(*p)
else:
	p = []
	for i in range(s.index('W'), n - 1):
		if s[i] == 'B':
			continue
		if s[i + 1:].count('W') == 0:
			break
		p.append(i + 1)
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
	print(len(p))
	print(*p)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	s = list(inp())
	new = deepcopy(s)
	ans = []
	for i in range(n - 1):
		if s[i] == 'B':
			continue
		else:
			s[i] = 'B'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			ans.append(i)
	if s[n - 1] == 'B':
		print(len(ans))
		print(' '.join((str(ans[i] + 1) for i in range(len(ans)))))
		return
	ans = []
	for i in range(n - 1):
		if new[i] == 'W':
			continue
		else:
			new[i] = 'W'
			if new[i + 1] == 'B':
				new[i + 1] = 'W'
			else:
				new[i + 1] = 'B'
			ans.append(i)
	if new[n - 1] == 'W':
		print(len(ans))
		print(' '.join((str(ans[i] + 1) for i in range(len(ans)))))
		return
	print(-1)
testcase(1)


import sys

def flip(c, i):
	if c[i] == 'W':
		c[i] = 'B'
	else:
		c[i] = 'W'
n = int(input())
c = list(input())
ops = []
for i in range(1, n - 1):
	if c[i - 1] != c[i]:
		flip(c, i)
		flip(c, i + 1)
		ops.append(i + 1)
if c[n - 1] != c[n - 2]:
	if n % 2 == 0:
		print(-1)
		sys.exit(0)
	for i in range(n // 2):
		ops.append(2 * i + 1)
print(len(ops))
print(' '.join([str(o) for o in ops]))


from sys import stdin
import math

def input():
	return stdin.readline()[:-1]
n = int(input())
l = list(input())
l2 = l[:]
if n == 1:
	print(-1)
else:
	i = 0
	pos = []
	while i < n - 1:
		if l[i] == 'W' and l[i + 1] == 'W':
			pos.append(i + 1)
			l[i] = 'B'
			l[i + 1] = 'B'
			i += 2
		elif l[i] == 'B' and l[i + 1] == 'B':
			i += 2
		elif l[i] == 'W' and l[i + 1] == 'B':
			pos.append(i + 1)
			l[i] = 'B'
			l[i + 1] = 'W'
			i += 1
		elif l[i] == 'B' and l[i + 1] == 'W':
			i += 1
	if l[-1] == 'B':
		print(len(pos))
		if len(pos) > 0:
			print(' '.join(map(str, pos)))
	else:
		i = 0
		pos2 = []
		while i < n - 1:
			if l2[i] == 'B' and l2[i + 1] == 'B':
				pos2.append(i + 1)
				l2[i] = 'W'
				l2[i + 1] = 'W'
				i += 2
			elif l2[i] == 'W' and l2[i + 1] == 'W':
				i += 2
			elif l2[i] == 'B' and l2[i + 1] == 'W':
				pos2.append(i + 1)
				l2[i] = 'W'
				l2[i + 1] = 'B'
				i += 1
			elif l2[i] == 'W' and l2[i + 1] == 'B':
				i += 1
		if l2[-1] == 'W':
			print(len(pos2))
			if len(pos2) > 0:
				print(' '.join(map(str, pos2)))
		else:
			print(-1)


def pairup(col, i):
	if i >= n:
		return 0
	if blocks[i] != col:
		pairup(col, i + 1)
	elif blocks[i] != blocks[i + 1]:
		(blocks[i], blocks[i + 1]) = (blocks[i + 1], blocks[i])
		seq.append(i + 1)
		pairup(col, i + 1)
	else:
		pairup(col, i + 2)

def invert(col):
	i = 0
	while i < n:
		if blocks[i] == col and blocks[i] == blocks[i + 1]:
			seq.append(i + 1)
			i += 2
		else:
			i += 1
n = int(input())
blocks = input()
bc = blocks.count('B')
wc = blocks.count('W')
blocks = list(blocks)
seq = []
if bc % 2 == 1 and wc % 2 == 1:
	print(-1)
elif bc == 0 or wc == 0:
	print(0)
else:
	if bc % 2 == 0:
		pairup('B', 0)
		invert('B')
	else:
		pairup('W', 0)
		invert('W')
	print(len(seq))
	print(' '.join([str(x) for x in seq]))


n = int(input())
s = list(input())
ans = []
f = 'W' if s.count('B') % 2 == 0 else 'B'
for i in range(0, len(s) - 1):
	if s[i] != f:
		ans.append(i + 1)
		s[i] = f
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
if s[len(s) - 1] == f:
	if len(ans) > 0:
		print(len(ans))
		print(*ans)
	else:
		print(0)
else:
	print(-1)


import sys
from math import ceil
input = sys.stdin.readline
n = int(input())
s = [True if x == 'W' else False for x in input().strip()]
r = s[:]
store = []
for i in range(n - 1):
	if s[i]:
		continue
	else:
		store.append(i + 1)
		s[i] = not s[i]
		s[i + 1] = not s[i + 1]
if s[-1]:
	print(len(store))
	print(*store)
else:
	store = []
	for i in range(n - 1):
		if not r[i]:
			continue
		else:
			store.append(i + 1)
			r[i] = not r[i]
			r[i + 1] = not r[i + 1]
	if not r[-1]:
		print(len(store))
		print(*store)
	else:
		print(-1)


n = int(input())
block = list(input())
W = 0
B = 0
moves = []
for x in block:
	if x == 'W':
		W += 1
	else:
		B += 1
status = 0
if W % 2 == 1 and B % 2 == 1:
	print(-1)
	status = -1
elif W % 2 == 0:
	for i in range(len(block) - 1):
		if block[i] == 'W':
			if block[i] == block[i + 1]:
				moves.append(i + 1)
				block[i] = 'B'
				block[i + 1] = 'B'
			else:
				moves.append(i + 1)
				(block[i], block[i + 1]) = (block[i + 1], block[i])
else:
	for i in range(len(block) - 1):
		if block[i] == 'B':
			if block[i] == block[i + 1]:
				moves.append(i + 1)
				block[i] = 'W'
				block[i + 1] = 'W'
			else:
				moves.append(i + 1)
				(block[i], block[i + 1]) = (block[i + 1], block[i])
if status != -1:
	moves = list(map(str, moves))
	print(len(moves))
	print(' '.join(moves))


def convert(arr):
	return ['1' if i == '0' else '0' for i in arr]

def solve2(arr):
	answer = []
	i = 0
	while i < len(arr) - 1:
		if arr[i] == '0' and arr[i + 1] == '0':
			arr[i] = '1'
			arr[i + 1] = '1'
			answer.append(i)
			i += 2
		else:
			i += 1
	indices = []
	for i in range(len(arr)):
		if arr[i] == '0':
			indices.append(i)
		if len(indices) == 2:
			answer.extend(list(range(indices[0], indices[1])))
			indices = []
	return answer
n = int(input())
arr = []
(cnt0, cnt1) = (0, 0)
for i in input().strip():
	arr.append('1') if i == 'B' else arr.append('0')
	if arr[-1] == '1':
		cnt1 += 1
	else:
		cnt0 += 1
if cnt1 % 2 != 0 and cnt0 % 2 != 0:
	print(-1)
else:
	answer = []
	if cnt1 % 2 == 0 and cnt0 % 2 == 0:
		if cnt0 >= cnt1:
			arr = convert(arr)
			(cnt0, cnt1) = (cnt1, cnt0)
	elif cnt0 % 2 != 0:
		arr = convert(arr)
		(cnt0, cnt1) = (cnt1, cnt0)
	answer = solve2(arr)
	answer = [i + 1 for i in answer]
	print(len(answer))
	if len(answer) != 0:
		print(*answer)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
string1 = [k for k in input()]
white = 0
black = 0
for s in range(len(string1)):
	if string1[s] == 'W':
		white += 1
	else:
		black += 1
if white == 0 or black == 0:
	print(0)
else:
	moves = 0
	outy = []
	for s in range(n - 1, 0, -1):
		val1 = string1[s]
		if val1 == 'B':
			if string1[s - 1] == 'B':
				(string1[s], string1[s - 1]) = ('W', 'W')
			elif string1[s - 1] == 'W':
				(string1[s], string1[s - 1]) = ('W', 'B')
			moves += 1
			outy.append(str(s))
	w1 = 0
	b1 = 0
	for s in range(n):
		if string1[s] == 'W':
			w1 += 1
		else:
			b1 += 1
	if w1 % 2 == 0 or b1 % 2 == 0:
		if w1 > 0 and b1 > 0:
			for s in range(n - 1, 0, -1):
				leftbord = string1[s - 1]
				if string1[s] == 'W':
					if leftbord == 'W':
						(string1[s], string1[s - 1]) = ('B', 'B')
					moves += 1
					outy.append(str(s))
			print(moves)
			print(' '.join(outy))
		else:
			print(moves)
			print(' '.join(outy))
	else:
		print(-1)


n = int(input())
s = input()

def function(s):
	if len(s) % 2 == 0:
		count = 0
		for elements in s:
			if elements == 'B':
				count += 1
			else:
				continue
		if count % 2 == 0:
			array_steps = []
			selection = False
			selected = ' '
			previous = 0
			change = 0
			i = 2
			for letters in s:
				if not selection:
					selection = True
					selected = letters
					continue
				if previous == 0:
					if letters != selected:
						array_steps.append(i)
						change = 1
					previous = letters
					i += 1
					continue
				if change == 1:
					if letters == selected:
						array_steps.append(i)
					else:
						change = 0
					i += 1
				else:
					if letters != selected:
						array_steps.append(i)
						change = 1
					i += 1
			return array_steps
		else:
			return -1
	else:
		array_steps = []
		count = 0
		for elements in s:
			if elements == 'B':
				count += 1
			else:
				continue
		if count % 2 == 0:
			selected = 'W'
			change = 0
			i = 1
			for letters in s:
				if change == 0:
					if letters == selected:
						i += 1
					else:
						array_steps.append(i)
						i += 1
						change = 1
				elif letters == selected:
					array_steps.append(i)
					i += 1
				else:
					i += 1
					change = 0
		else:
			selected = 'B'
			change = 0
			i = 1
			for letters in s:
				if change == 0:
					if letters == selected:
						i += 1
					else:
						array_steps.append(i)
						i += 1
						change = 1
				elif letters == selected:
					array_steps.append(i)
					i += 1
				else:
					i += 1
					change = 0
		return array_steps
if function(s) == -1:
	print(-1)
else:
	print(len(function(s)))
	answer = ''
	for elements in function(s):
		answer += str(elements) + ' '
	print(answer)


import sys
n = int(input())
s = list(input())
s2 = s.copy()
ans = []
for i in range(n - 1):
	if s[i] == 'B':
		ans.append(i + 1)
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
if s[n - 1] == 'W':
	print(len(ans))
	print(' '.join(map(str, ans)))
	sys.exit()
ans = []
for i in range(n - 1):
	if s2[i] == 'W':
		ans.append(i + 1)
		if s2[i + 1] == 'B':
			s2[i + 1] = 'W'
		else:
			s2[i + 1] = 'B'
if s2[n - 1] == 'B':
	print(len(ans))
	print(' '.join(map(str, ans)))
	sys.exit()
print('-1')


n = int(input())
s = list(input())
arr = []
for i in s:
	if i == 'B':
		arr.append(1)
	else:
		arr.append(0)
toMake = arr[0]
count = 0
affected = []
for i in range(1, len(arr) - 1):
	if arr[i] != toMake:
		arr[i] = 1 - arr[i]
		arr[i + 1] = 1 - arr[i + 1]
		affected.append(i + 1)
		count += 1
if arr.count(toMake) == len(arr):
	print(count)
	print(*affected)
else:
	toMake = 1 - toMake
	for i in range(len(arr) - 1):
		if arr[i] != toMake:
			arr[i] = 1 - arr[i]
			arr[i + 1] = 1 - arr[i + 1]
			affected.append(i + 1)
			count += 1
	if arr.count(toMake) == len(arr):
		print(count)
		print(*affected)
	else:
		print(-1)


from collections import Counter
_ = int(input())
s = list(input())
counter = Counter(s)
(bs, ws) = (counter['B'], counter['W'])
if bs % 2 != 0 and ws % 2 != 0:
	print(-1)
else:
	c = 'W' if ws % 2 == 0 else 'B'
	ops = []
	i = 0
	while i < len(s) - 1:
		if s[i] == c:
			if s[i + 1] != c:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				ops.append(i + 1)
			else:
				ops.append(i + 1)
				i += 1
		i += 1
	print(len(ops))
	if len(ops):
		print(*ops)


n = int(input())
s = input()
lis = [i for i in s]
che_black = ['B'] * n
ans = []
for i in range(n - 1):
	if lis[i] == 'W':
		ans.append(i + 1)
		lis[i] = 'B'
		if lis[i + 1] == 'W':
			lis[i + 1] = 'B'
		else:
			lis[i + 1] = 'W'
if lis == che_black:
	print(len(ans))
	print(*ans)
else:
	lis = [i for i in s]
	che_white = ['W'] * n
	ans = []
	for i in range(n - 1):
		if lis[i] == 'B':
			ans.append(i + 1)
			lis[i] = 'W'
			if lis[i + 1] == 'W':
				lis[i + 1] = 'B'
			else:
				lis[i + 1] = 'W'
	if lis == che_white:
		print(len(ans))
		print(*ans)
	else:
		print(-1)


n = int(input())
s = input()
from collections import Counter
c = Counter(s)
if (c['B'] % 2 == 1 and c['W'] > 0 or (c['B'] > 0 and c['W'] % 2 == 1)) and len(s) % 2 == 0:
	print(-1)
else:
	s = list(s)
	scopy = s[:]
	targ = s[0]
	d = {'W': 'B', 'B': 'W'}
	c = 0
	ans = []
	while len(set(s)) != 1:
		for i in range(len(s) - 1):
			if s[i] != targ:
				ans.append(i + 1)
				(s[i], s[i + 1]) = (targ, d[s[i + 1]])
				break
		c += 1
		if c > 3 * len(s):
			c = 0
			targ = d[targ]
			s = scopy[:]
			ans = []
			continue
	print(c)
	print(' '.join(list(map(str, ans))))


def solve1(str, c, d):
	nw = str[0]
	ans = []
	pos = 0
	for i in str[1:]:
		pos += 1
		if nw == d:
			ans.append(pos)
			nw = i
			if i == d:
				nw = c
			else:
				nw = d
		else:
			nw = i
	if nw == c:
		print(len(ans))
		for i in ans:
			print(i, end=' ')
		print('')
		return 1
n = input()
s = input()
if solve1(s, 'B', 'W') == 1:
	1
elif solve1(s, 'W', 'B') == 1:
	1
else:
	print(-1)


n = int(input())
b = input()
a = []
for i in b:
	a.append(i)
wn = a.count('W')
bn = a.count('B')
if wn == 0 or bn == 0:
	print(0)
elif wn % 2 != 0 and bn % 2 != 0:
	print(-1)
else:
	c = '-'
	count = 0
	ans = []
	if wn % 2 == 0:
		c = 'W'
	else:
		c = 'B'
	for i in range(n - 1):
		if a[i] == c:
			if a[i] == 'B':
				a[i] = 'W'
			else:
				a[i] = 'B'
			if a[i + 1] == 'B':
				a[i + 1] = 'W'
			else:
				a[i + 1] = 'B'
			count += 1
			ans.append(i + 1)
	print(count)
	print(*ans)


N = int(input())
S = input()
black = []
white = []
for (i, s) in enumerate(S, 1):
	if s == 'B':
		black.append(i)
	elif s == 'W':
		white.append(i)
black_num = len(black)
white_num = len(white)
if black_num == 0 or white_num == 0:
	print(0)
	exit()
if black_num % 2 == 1 and white_num % 2 == 1:
	print(-1)
	exit()
if white_num % 2 == 0:
	adopt = white
elif black_num % 2 == 0:
	adopt = black
process = []
for i in range(0, len(adopt) - 1, 2):
	process += list(range(adopt[i], adopt[i + 1])[::-1])
print(len(process))
print(*process)


t = int(input())
string = input()
changes = []
adopted = [i for i in string]
count = 0
i = 0
while i < t - 1:
	if adopted[i] == 'B':
		i += 1
	else:
		adopted[i] = 'B'
		count += 1
		changes.append(i + 1)
		if adopted[i + 1] == 'W':
			adopted[i + 1] = 'B'
		else:
			adopted[i + 1] = 'W'
if adopted[t - 1] == 'B':
	print(count)
	for i in changes:
		print(i, end=' ')
else:
	del changes, adopted
	adopted = [i for i in string]
	changes = []
	check = -1
	count = 0
	i = 0
	while i < t - 1:
		if adopted[i] == 'W':
			i += 1
		else:
			adopted[i] = 'W'
			count += 1
			changes.append(i + 1)
			if adopted[i + 1] == 'W':
				adopted[i + 1] = 'B'
			else:
				adopted[i + 1] = 'W'
	if adopted[t - 1] == 'W':
		print(count)
		for i in changes:
			print(i, end=' ')
	else:
		print(-1)


import os
import sys
from io import BytesIO, IOBase

def solve(n, sarr):
	ans = []
	if len(sarr) <= 1:
		return 0

	def flip(x, y):
		ans.append(x + 1)
		sarr[x] = 'B' if sarr[x] == 'W' else 'W'
		sarr[y] = 'B' if sarr[y] == 'W' else 'W'
	for (i, c) in enumerate(sarr[1:-1]):
		i = i + 1
		if sarr[i] != sarr[i - 1]:
			flip(i, i + 1)
	if sarr[-1] == sarr[-2]:
		return ans
	if n % 2 == 0:
		return -1
	ans.extend([i + 1 for i in range(0, n - 1, 2)])
	return ans

def main():
	n = int(input().strip())
	sarr = list(input().strip())
	ans = solve(n, sarr)
	if type(ans) is int and ans <= 0:
		print(ans)
	else:
		print(len(ans))
		print(' '.join(list(map(str, ans))))
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


n = int(input())
s = input()
co = []
for i in range(0, n):
	if s[i] == 'B':
		co.append(0)
	else:
		co.append(1)
bl = co.copy()
wl = co.copy()
abl = []
awl = []
for i in range(0, n - 1):
	if bl[i] == 0:
		pass
	else:
		bl[i] = 0
		abl.append(i + 1)
		bl[i + 1] = (bl[i + 1] + 1) % 2
for i in range(0, n - 1):
	if wl[i] == 1:
		pass
	else:
		wl[i] = 1
		awl.append(i + 1)
		wl[i + 1] = (wl[i + 1] + 1) % 2
if bl.count(1) % 2 == 0:
	if bl.count(1) == 0:
		pass
	else:
		last = bl.index(1)
		for i in range(last, n, 2):
			abl += [i + 1]
	print(len(abl))
	print(*abl)
elif wl.count(0) % 2 == 0:
	if wl.count(0) == 0:
		pass
	else:
		last = wl.index(0)
		for i in range(last, n, 2):
			awl += [i + 1]
	print(len(awl))
	print(*awl)
else:
	print(-1)


def main():
	n = int(input())
	S = list(input())
	b = 0
	w = 0
	T = [0] * n
	for i in range(n):
		if S[i] == 'B':
			b += 1
		else:
			w += 1
			T[i] = 1
	if b % 2 == 1 and w % 2 == 1:
		print(-1)
		return
	count = 0
	ans = []
	if b % 2 == 1:
		for i in range(n - 1):
			if T[i] == 0:
				continue
			T[i] = 0
			T[i + 1] = 1 - T[i + 1]
			count += 1
			ans.append(i + 1)
	else:
		for i in range(n - 1):
			if T[i] == 1:
				continue
			T[i] = 1
			T[i + 1] = 1 - T[i + 1]
			count += 1
			ans.append(i + 1)
	print(count)
	if count == 0:
		return
	print(' '.join(map(str, ans)))
main()


from copy import copy

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())

def comp(a):
	return a[0]
k = int_inp()
arr = [el == 'W' for el in input()]
out = []
s = sum(arr)
if s == 0 or s == k:
	print(0)
else:
	if s % 2 == 0:
		for i in range(k - 1):
			if arr[i]:
				arr[i] = not arr[i]
				arr[i + 1] = not arr[i + 1]
				out.append(i)
	elif (k - s) % 2 == 0:
		for i in range(k - 1):
			if not arr[i]:
				arr[i] = not arr[i]
				arr[i + 1] = not arr[i + 1]
				out.append(i)
	if len(out) == 0 or (sum(arr) != 0 and sum(arr) != k):
		print(-1)
	else:
		print(len(out))
		for el in out:
			print(el + 1, end=' ')


def main():
	n = int(input())
	s = input()
	w = s.count('W')
	b = s.count('B')
	if w == 0 or b == 0:
		print(0)
		return
	s_s = [i for i in s]
	res = []
	for i in range(1, len(s_s) - 1):
		if s_s[i] != s_s[i - 1]:
			s_s[i] = invert(s_s[i])
			s_s[i + 1] = invert(s_s[i + 1])
			res.append(str(i + 1))
	for i in range(len(s_s) - 2, 0, -1):
		if s_s[i] != s_s[i + 1]:
			s_s[i] = invert(s_s[i])
			s_s[i - 1] = invert(s_s[i - 1])
			res.append(str(i))
	if s_s[-1] != s_s[0]:
		print(-1)
		return
	length = len(res)
	res = ' '.join(res)
	if length == 0:
		print(length)
	else:
		print(length)
		print(res)

def invert(c):
	if c == 'W':
		c = 'B'
	else:
		c = 'W'
	return c
main()


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
s = [0 if c == 'B' else 1 for c in input()]
c = [s.count(0), s.count(1)]
for i in (0, 1):
	if c[i] % 2 == 0:
		t = i
		break
else:
	print(-1)
	exit()
out = []
for i in range(n - 1):
	if s[i] == t:
		s[i] = 1 - s[i]
		s[i + 1] = 1 - s[i + 1]
		out.append(i + 1)
print(len(out))
print(' '.join((str(x) for x in out)))


n = int(input())
l = list(input())

def isDone(l, target):
	return l == [target] * len(l)
count = 0
steps = ''
target = l[0]
for i in range(len(l) - 1):
	if l[i] != target:
		count += 1
		steps += str(i + 1) + ' '
		l[i] = target
		if l[i + 1] == 'B':
			l[i + 1] = 'W'
		else:
			l[i + 1] = 'B'
	if isDone(l, target):
		break
if isDone(l, target) == False:
	l.reverse()
	target = l[0]
	for i in range(len(l) - 1):
		if l[i] != target:
			count += 1
			steps += str(len(l) - i - 1) + ' '
			l[i] = target
			if l[i + 1] == 'B':
				l[i + 1] = 'W'
			else:
				l[i + 1] = 'B'
		if isDone(l, target):
			break
if isDone(l, target) == False:
	print(-1)
else:
	print(count)
	print(steps[:-1])


import os
import sys

def main():
	N = read_int()
	S = inp()
	ans = solve(N, S)
	if ans is None:
		print('-1')
		return
	print(len(ans))
	if ans:
		print(*[x + 1 for x in ans])

def solve(N, S):
	A = [0 if c == 'W' else 1 for c in S]
	ans = []
	for i in range(1, N - 1):
		if A[i - 1] != A[i]:
			ans.append(i)
			A[i] = 1 - A[i]
			A[i + 1] = 1 - A[i + 1]
	if A[-1] == A[-2]:
		return ans
	A = [0 if c == 'W' else 1 for c in S]
	A[0] = 1 - A[0]
	A[1] = 1 - A[1]
	ans = [0]
	for i in range(1, N - 1):
		if A[i - 1] != A[i]:
			ans.append(i)
			A[i] = 1 - A[i]
			A[i + 1] = 1 - A[i + 1]
	if A[-1] == A[-2]:
		return ans
	return None
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def main():
	n = int(input())
	s = input()
	b = 0
	w = 0
	a = []
	sec = []
	for i in s:
		if i == 'B' or i == 'W':
			a.append(i)
			sec.append(i)
	ans = []
	for i in range(len(a) - 1):
		if a[i] == 'W':
			a[i] = 'B'
			ans.append(i + 1)
			if a[i + 1] == 'B':
				a[i + 1] = 'W'
			else:
				a[i + 1] = 'B'
	f = 1
	for i in a:
		if i == 'W':
			f = 0
			break
	if f == 1:
		print(len(ans))
		print(*ans)
		return
	ans = []
	for i in range(len(a) - 1):
		if sec[i] == 'B':
			sec[i] = 'W'
			ans.append(i + 1)
			if sec[i + 1] == 'B':
				sec[i + 1] = 'W'
			else:
				sec[i + 1] = 'B'
	f = 1
	for i in sec:
		if i == 'B':
			f = 0
			break
	if f:
		print(len(ans))
		print(*ans)
		return
	print(-1)
	return
main()


n = int(input())
s = list(input())
x = 'B'

def check(l):
	prev = l[0]
	for i in range(len(l)):
		if l[i] != prev:
			return False
	return True
count = 0
ans = [i for i in s]
l = []
for i in range(n - 1):
	if s[i] != x:
		s[i] = x
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		l.append(i + 1)
		count += 1
if count <= 3 * n and check(s):
	print(count)
	print(*l)
else:
	x = 'W'
	count = 0
	l = []
	s = [i for i in ans]
	for i in range(n - 1):
		if s[i] != x:
			s[i] = x
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			l.append(i + 1)
			count += 1
	if count <= 3 * n and check(s):
		print(count)
		print(*l)
	else:
		print(-1)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
n = inputnum()
s = inputstring()
ans = []
for i in range(n - 1):
	if s[i] == 'B':
		s[i] = 'W'
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		ans.append(i + 1)
if s[n - 1] == 'W':
	print(len(ans))
	print(*ans)
elif n % 2 == 1:
	for i in range(0, n - 1, 2):
		ans.append(i + 1)
	print(len(ans))
	print(*ans)
else:
	print(-1)


n = int(input())
s = list(input())
b = []
a = []
for i in range(n):
	a.append(s[i])
	b.append(s[i])
c = []
for i in range(n - 1):
	if a[i] == 'W':
		continue
	else:
		a[i] = 'W'
		c.append(i + 1)
		if a[i + 1] == 'W':
			a[i + 1] = 'B'
		else:
			a[i + 1] = 'W'
if a.count('W') == n:
	print(len(c))
	print(*c)
else:
	d = []
	for i in range(n - 1):
		if b[i] == 'B':
			continue
		else:
			b[i] = 'B'
			d.append(i + 1)
			if b[i + 1] == 'W':
				b[i + 1] = 'B'
			else:
				b[i + 1] = 'W'
	if b.count('B') == n:
		print(len(d))
		print(*d)
	else:
		print(-1)


n = int(input())
s = list(input())
l = []

def make_white(s):
	for i in range(len(s) - 1):
		if s[i] == 'W':
			continue
		else:
			l.append(i + 1)
			s[i] = 'W'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
	if s[-1] == 'W':
		return True
	else:
		return False

def make_black(s):
	for i in range(len(s) - 1):
		if s[i] == 'B':
			continue
		else:
			l.append(i + 1)
			s[i] = 'B'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
	if s[-1] == 'B':
		return True
	else:
		return False
if make_white(s) and len(l) < 3 * n:
	print(len(l))
	print(*l)
elif make_black(s) and len(l) < 3 * n:
	print(len(l))
	print(*l)
else:
	print('-1')


import os
from math import *

def checker(s, s1, ans):
	for i in range(n - 1):
		if s[i] == s1:
			if s[i] == 'B':
				s[i] = 'W'
			else:
				s[i] = 'B'
			ans.append(i + 1)
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
	return ans
n = int(input())
s = input()
s = list(s)
if 'B' not in s or 'W' not in s:
	print('0')
else:
	ans = []
	ans = checker(s, 'W', ans)
	if len(set(s)) == 1:
		print(len(ans))
		for x in ans:
			print(x, end=' ')
	else:
		ans = checker(s, 'B', ans)
		if len(set(s)) == 1:
			print(len(ans))
			for x in ans:
				print(x, end=' ')
		else:
			print('-1')


n = int(input())
s = list(str(input()))
ans = []
countW = 0
countB = 0
bol = False
if len(set(s)) == 1:
	print(0)
	exit(0)
for i in range(n):
	if s[i] == 'B':
		countB += 1
	else:
		countW += 1
if countB & 1 == 1 and countW & 1 == 1:
	print(-1)
	exit(0)
i = 0
while i < n - 1:
	if i == 0 and s[i] == 'B':
		i += 1
		continue
	elif i == 0 and s[i] == 'W':
		if s[i + 1] == 'B':
			s[i] = 'B'
			s[i + 1] = 'W'
			ans.append(i + 1)
			i += 1
		elif s[i + 1] == 'W':
			s[i] = 'B'
			s[i + 1] = 'B'
			ans.append(i + 1)
			i += 2
		continue
	if s[i] == 'W':
		if s[i + 1] == 'B':
			s[i] = 'B'
			s[i + 1] = 'W'
			ans.append(i + 1)
			i += 1
		elif s[i + 1] == 'W':
			s[i] = 'B'
			s[i + 1] = 'B'
			ans.append(i + 1)
			i += 2
		continue
	else:
		i += 1
		continue
if len(set(s)) == 1:
	print(len(ans))
	for i in ans:
		print(i, end=' ')
else:
	i = 0
	while i < n - 1:
		if i == 0 and s[i] == 'W':
			i += 1
			continue
		elif i == 0 and s[i] == 'B':
			if s[i + 1] == 'W':
				s[i] = 'W'
				s[i + 1] = 'B'
				ans.append(i + 1)
				i += 1
			elif s[i + 1] == 'B':
				s[i] = 'W'
				s[i + 1] = 'W'
				ans.append(i + 1)
				i += 2
			continue
		if s[i] == 'B':
			if s[i + 1] == 'W':
				s[i] = 'W'
				s[i + 1] = 'B'
				ans.append(i + 1)
				i += 1
			elif s[i + 1] == 'B':
				s[i] = 'W'
				s[i + 1] = 'W'
				ans.append(i + 1)
				i += 2
			continue
		else:
			i += 1
			continue
	if len(set(s)) == 1:
		print(len(ans))
		for i in ans:
			print(i, end=' ')
	else:
		print(-1)


n = int(input())
s = str(input())
l = list(s)
lt = list(s)
l1 = []
l2 = []
for i in range(n - 1):
	if l[i] == 'W':
		l1.append(i + 1)
		l[i] = 'B'
		if l[i + 1] == 'W':
			l[i + 1] = 'B'
		else:
			l[i + 1] = 'W'
if l[n - 1] == 'B':
	print(len(l1))
	for i in l1:
		print(i, end=' ')
	print()
else:
	for i in range(n - 1):
		if lt[i] == 'B':
			l2.append(i + 1)
			lt[i] = 'W'
			if lt[i + 1] == 'B':
				lt[i + 1] = 'W'
			else:
				lt[i + 1] = 'B'
	if lt[n - 1] == 'W':
		print(len(l2))
		for i in l2:
			print(i, end=' ')
		print()
	else:
		print(-1)


n = int(input())
s = str(input())
s1 = list(s)
b = 'B'
w = 'W'
if s1.count(b) % 2 != 0 and s1.count(w) % 2 != 0:
	print(-1)
elif s1.count(b) % 2 != 0 and s1.count(w) % 2 == 0:
	k = s1.count(w)
	a = []
	i = 0
	while i < len(s) - 2:
		if s1[i] == 'W' and s1[i + 1] != 'W':
			temp = s1[i]
			s1[i] = s1[i + 1]
			s1[i + 1] = temp
			a.append(i + 1)
		elif s1[i] == 'W' and s1[i + 1] == 'W':
			i = i + 2
			continue
		i = i + 1
	for j in range(0, k // 2):
		p = s1.index(w)
		s1[p] = b
		s1[p + 1] = b
		a.append(p + 1)
	print(len(a))
	for j in range(0, len(a)):
		print(a[j], end=' ')
elif s1.count(b) % 2 == 0 and s1.count(w) % 2 != 0:
	k = s1.count(b)
	a = []
	i = 0
	while i < len(s) - 2:
		if s1[i] == 'B' and s1[i + 1] != 'B':
			temp = s1[i]
			s1[i] = s1[i + 1]
			s1[i + 1] = temp
			a.append(i + 1)
		elif s1[i] == 'B' and s1[i + 1] == 'B':
			i = i + 2
			continue
		i = i + 1
	for j in range(0, k // 2):
		p = s1.index(b)
		s1[p] = w
		s1[p + 1] = w
		a.append(p + 1)
	print(len(a))
	for j in range(0, len(a)):
		print(a[j], end=' ')
else:
	k = s1.count(b)
	a = []
	i = 0
	while i < len(s) - 2:
		if s1[i] == 'B' and s1[i + 1] != 'B':
			temp = s1[i]
			s1[i] = s1[i + 1]
			s1[i + 1] = temp
			a.append(i + 1)
		elif s1[i] == 'B' and s1[i + 1] == 'B':
			i = i + 2
			continue
		i = i + 1
	for j in range(0, k // 2):
		p = s1.index(b)
		s1[p] = w
		s1[p + 1] = w
		a.append(p + 1)
	print(len(a))
	for j in range(0, len(a)):
		print(a[j], end=' ')


n = int(input())
s = input()
s = s.replace('B', '0')
s = s.replace('W', '1')
zcount = s.count('0')
ocount = s.count('1')
if zcount == 0 or ocount == 0:
	print(0)
elif zcount % 2 != 0 and ocount % 2 != 0:
	print(-1)
else:
	ans = []
	idx = []
	bit = '0'
	if zcount % 2 == 0 and ocount % 2 == 0:
		if zcount < ocount:
			bit = '0'
		else:
			bit = '1'
	elif zcount % 2 == 0:
		bit = '0'
	else:
		bit = '1'
	for x in range(len(s)):
		if s[x] == bit:
			idx.append(x)
	for y in range(len(idx) - 1, -1, -2):
		for k in range(idx[y] - 1, idx[y - 1] - 1, -1):
			ans.append(str(k + 1))
	if len(ans) <= 3 * len(s):
		print(len(ans))
		print(' '.join(ans))
	else:
		print(-1)


n = int(input())
s = list(input())

def DP_(color1, color2):
	DP = [[None for _ in range(2)] for _ in range(len(s))]
	DP[-1][0] = 0 if s[-1] == color1 else 10 ** 10
	DP[-1][1] = 0 if s[-1] == color2 else 10 ** 10
	parents = {}
	for i in range(len(s) - 2, -1, -1):
		DP[i][0] = DP[i + 1][0] if s[i] == color1 else DP[i + 1][1] + 1
		DP[i][1] = DP[i + 1][0] if s[i] == color2 else DP[i + 1][1] + 1
		parents[i, 0] = (i + 1, 0, 'F') if s[i] == color1 else (i + 1, 1, 'T')
		parents[i, 1] = (i + 1, 0, 'F') if s[i] == color2 else (i + 1, 1, 'T')
	return (DP, parents)

def print_solution(parents_dict):
	current = (0, 0)
	changed = []
	for i in range(len(s)):
		(a, b, c) = parents_dict[current]
		current = (a, b)
		if c == 'T':
			changed.append(i)
		if a == len(s) - 1:
			break
	return changed
(DP1, parents1) = DP_('W', 'B')
(DP2, parents2) = DP_('B', 'W')
if DP1[0][0] < 10 ** 9:
	print(DP1[0][0])
	print(' '.join([str(x + 1) for x in print_solution(parents1)]))
elif DP2[0][0] < 10 ** 9:
	print(DP2[0][0])
	print(' '.join([str(x + 1) for x in print_solution(parents2)]))
else:
	print(-1)


n = int(input())
it = list(input())
tt = it[:]
ans = []
for i in range(n - 1):
	if it[i] == 'W':
		it[i] = 'B'
		if it[i + 1] == 'B':
			it[i + 1] = 'W'
		else:
			it[i + 1] = 'B'
		ans.append(i + 1)
if it[-1] == 'B':
	print(len(ans))
	print(*ans)
else:
	it = tt[:]
	ans = []
	for i in range(n - 1):
		if it[i] == 'B':
			it[i] = 'W'
			if it[i + 1] == 'B':
				it[i + 1] = 'W'
			else:
				it[i + 1] = 'B'
			ans.append(i + 1)
	if it[-1] == 'W':
		print(len(ans))
		print(*ans)
	else:
		print(-1)


n = int(input())
a = input()
b = list(a)
e = -1
m = 0
if a.count('W') == len(a) or a.count('B') == len(a):
	print(0)
	m = 1
elif a == 'BWB' or a == 'WBW':
	print(2)
	print(2, 1)
	m = 1
elif a.count('W') % 2 != 0 and a.count('B') % 2 != 0:
	print(-1)
	m = 1
elif a.count('W') % 2 == 0:
	ans = []
	while b.count('W') > 0:
		c = b.index('W', e + 1)
		d = b.index('W', c + 1)
		for i in range(c, d + 1):
			b[i] = 'B'
		for i in range(c, d):
			ans.append(i + 1)
elif a.count('B') % 2 == 0:
	ans = []
	while b.count('B') > 0:
		c = b.index('B', e + 1)
		d = b.index('B', c + 1)
		for i in range(c, d + 1):
			b[i] = 'W'
		for i in range(c, d):
			ans.append(i + 1)
if m != 1:
	print(len(ans))
	for i in ans:
		print(i, end=' ')


n = int(input())
s = list(input())
b = s.count('B')
w = s.count('W')
order = []
if b % 2 and w % 2:
	print(-1)
else:
	cur = 'B' if b % 2 else 'W'
	notcur = 'B' if cur == 'W' else 'W'
	for i in range(n - 1):
		if s[i] == cur:
			continue
		order.append(i + 1)
		s[i + 1] = cur if s[i + 1] != cur else notcur
	print(len(order))
	if len(order):
		print(' '.join(list(map(str, order))))


import sys
n = int(sys.stdin.readline().strip())
a = [0] * n
cnt = [0, 0]
for (i, v) in enumerate(sys.stdin.readline().strip()):
	if v == 'B':
		a[i] = 1
		cnt[1] += 1
	else:
		a[i] = 0
		cnt[0] += 1
if cnt[0] % 2 == 1 and 1 == cnt[1] % 2:
	print(-1)
else:
	total = 0
	ans = []
	for i in range(n - 1):
		if a[i] == 0:
			total += 1
			ans.append(i + 1)
			a[i] = 1
			if a[i + 1] == 1:
				a[i + 1] = 0
			else:
				a[i + 1] = 1
	cnt1 = a.count(1)
	cnt0 = a.count(0)
	if cnt0 > 0 and cnt1 % 2 == 0:
		total += cnt1 // 2
		for i in range(1, cnt1 + 1, 2):
			ans.append(i)
	print(total)
	for i in ans:
		print(i, end=' ')


n = int(input())
a = list(input())
if a.count('B') % 2 and a.count('W') % 2:
	print(-1)
else:
	if a.count('W') % 2:
		for q in range(len(a)):
			if a[q] == 'W':
				a[q] = 'B'
			else:
				a[q] = 'W'
	ans = []
	for q in range(len(a) - 1):
		if a[q] == 'W' and a[q + 1] == 'W':
			ans.append(q + 1)
			a[q] = a[q + 1] = 'B'
		elif a[q] == 'W':
			ans.append(q + 1)
			(a[q], a[q + 1]) = ('B', 'W')
	print(len(ans))
	print(*ans)


n = int(input())
arr = [i for i in input()]
counter = 0
ans = []
for i in range(n - 1):
	if arr[i] == 'B':
		arr[i] = 'W'
		if arr[i + 1] == 'B':
			arr[i + 1] = 'W'
		else:
			arr[i + 1] = 'B'
		counter += 1
		ans.append(i + 1)
if len(set(arr)) != 1:
	for i in range(n - 1):
		if arr[i] == 'W':
			arr[i] = 'B'
			if arr[i + 1] == 'W':
				arr[i + 1] = 'B'
			else:
				arr[i + 1] = 'W'
			counter += 1
			ans.append(i + 1)
	if len(set(arr)) != 1:
		print(-1)
	else:
		print(counter)
		print(*ans)
else:
	print(counter)
	print(*ans)


n = int(input())
arr = list(input())
ori = arr[:]
temp = []
for i in range(n - 1):
	if arr[i] == 'W':
		temp += [i + 1]
		arr[i] = 'B'
		if arr[i + 1] == 'W':
			arr[i + 1] = 'B'
		else:
			arr[i + 1] = 'W'
if arr[-1] == 'B':
	print(len(temp))
	print(*temp)
	exit()
temp = []
arr = ori[:]
for i in range(n - 1):
	if arr[i] == 'B':
		temp += [i + 1]
		arr[i] = 'W'
		if arr[i + 1] == 'W':
			arr[i + 1] = 'B'
		else:
			arr[i + 1] = 'W'
if arr[-1] == 'W':
	print(len(temp))
	print(*temp)
	exit()
print(-1)


n = int(input())
s = input()
ss = s
s = list(s)
ss = list(ss)
a = []
b = []
for i in range(n - 1):
	if s[i] == 'W':
		s[i] = 'B'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		a.append(i + 1)
for i in range(n - 1):
	if ss[i] == 'B':
		ss[i] = 'W'
		if ss[i + 1] == 'B':
			ss[i + 1] = 'W'
		else:
			ss[i + 1] = 'B'
		b.append(i + 1)
if 'W' not in s:
	print(len(a))
	print(*a)
elif 'B' not in ss:
	print(len(b))
	print(*b)
else:
	print(-1)


from sys import stdin, stdout
n = int(input())
s = list(input())
tmp = list()
tmp += s
if len(set(s)) == 1:
	print(0)
else:
	ans = []
	for i in range(n - 1):
		if s[i] == 'B':
			s[i] = 'W'
			s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
			ans.append(str(i + 1))
	if len(set(s)) == 1:
		print(len(ans))
		print(' '.join(ans))
	else:
		s = tmp
		ans = []
		for i in range(n - 1):
			if s[i] == 'W':
				s[i] = 'B'
				s[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
				ans.append(str(i + 1))
		if len(set(s)) == 1:
			print(len(ans))
			print(' '.join(ans))
		else:
			print(-1)


n = int(input())
s = list(input())
sequence = []
for i in range(n - 1):
	if s[i] == 'B' and s[i + 1] == 'W':
		s[i] = 'W'
		s[i + 1] = 'B'
		sequence.append(i)
	if s[i] == 'B' and s[i + 1] == 'B':
		s[i] = 'W'
		s[i + 1] = 'W'
		sequence.append(i)
if s[n - 1] == 'B':
	if n % 2 == 0:
		sequence = [-1]
	else:
		sequence.extend([i for i in range(0, n - 1, 2)])
if len(sequence) == 1 and sequence[0] == -1:
	print(-1)
elif len(sequence) == 0:
	print(0)
else:
	print(len(sequence))
	print(*list(map(lambda x: x + 1, sequence)))


def minKBitFlips(A):
	K = 2
	N = len(A)
	hint = [0] * N
	flip = 0
	ans = []
	for (i, x) in enumerate(A):
		flip ^= hint[i]
		if x ^ flip == 0:
			ans.append(i + 1)
			if i + K > N:
				return -1
			flip ^= 1
			if i + K < N:
				hint[i + K] ^= 1
	return ans
import sys
n = int(input())
a = sys.stdin.readline().strip()
A = []
B = []
for i in range(n):
	if a[i] == 'B':
		A.append(1)
		B.append(0)
	else:
		A.append(0)
		B.append(1)
x = minKBitFlips(A)
y = minKBitFlips(B)
if x == -1 and y == -1:
	print(-1)
elif x == -1:
	print(len(y))
	print(' '.join(list(map(str, y))))
else:
	print(len(x))
	print(' '.join(list(map(str, x))))


n = int(input())
s = input()
l = list(s)
protocol = []
i = 0
while i < n - 1:
	if l[i:i + 2] == ['W', 'B'] and i < n - 2 and (l[i + 2] == 'W'):
		l[i + 1] = 'W'
		l[i + 2] = 'B'
		protocol.append(i + 2)
		i += 2
	elif l[i:i + 2] == ['B', 'W']:
		l[i] = 'W'
		l[i + 1] = 'B'
		protocol.append(i + 1)
		i += 1
	elif l[i:i + 2] == ['B', 'B']:
		l[i] = 'W'
		l[i + 1] = 'W'
		protocol.append(i + 1)
		i += 1
	else:
		i += 1
if l[n - 1] == 'B':
	i = 0
	while i < n - 1:
		if l[i:i + 2] == ['B', 'W'] and i < n - 2 and (l[i + 2] == 'B'):
			l[i + 1] = 'B'
			l[i + 2] = 'W'
			protocol.append(i + 2)
			i += 2
		elif l[i:i + 2] == ['W', 'B']:
			l[i] = 'B'
			l[i + 1] = 'W'
			protocol.append(i + 1)
			i += 1
		elif l[i:i + 2] == ['W', 'W']:
			l[i] = 'B'
			l[i + 1] = 'B'
			protocol.append(i + 1)
			i += 1
		else:
			i += 1
	if l[n - 1] == 'W':
		print(-1)
	else:
		print(len(protocol))
		print(' '.join(map(str, protocol)))
else:
	print(len(protocol))
	print(' '.join(map(str, protocol)))


import os
import sys
from io import BytesIO, IOBase
import math
import itertools
import bisect
import heapq

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	for i in range(2, n + 1):
		if primes[i]:
			for j in range(i + i, n + 1, i):
				primes[j] = False
	p = []
	for i in range(0, n + 1):
		if primes[i]:
			p.append(i)
	return p

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def solve(ch):
	ind = []
	for i in range(0, n):
		if s[i] == ch:
			ind.append(i + 1)
	for i in range(1, len(ind), 2):
		for j in range(ind[i], ind[i - 1], -1):
			ans.append(j - 1)
n = int(input())
s = list(input())
cnt1 = s.count('W')
if cnt1 % 2 == 1 and (n - cnt1) % 2 == 1:
	print(-1)
else:
	ans = []
	if cnt1 % 2 == 0:
		solve('W')
	else:
		solve('B')
	print(len(ans))
	print(*ans)


n = int(input())
a = list(input())
w = a.count('W')
b = n - w
flag = True
if (w - b) % 4 == n % 4:
	flag = False
	c = 'W'
elif (b - w) % 4 == n % 4:
	flag = False
	c = 'B'
if flag:
	print(-1)
else:
	p = []
	for i in range(n - 1):
		if a[i] != c:
			p.append(str(i + 1))
			a[i] = c
			if a[i + 1] == 'W':
				a[i + 1] = 'B'
			else:
				a[i + 1] = 'W'
	print(len(p))
	print(' '.join(p))


n = int(input())
r = list(input())
for t in range(len(r)):
	if r[t] == 'B':
		r[t] = 1
	else:
		r[t] = -1
g = 0
m = 0
l = []
jk = []
o = list(r)
for i in range(0, n - 1):
	if r[i] == -1:
		r[i] = -r[i]
		r[i + 1] = -r[i + 1]
		l += [i + 1]
if r[n - 1] != 1:
	g = 1
for q in range(0, n - 1):
	if o[q] == 1:
		o[q] = -o[q]
		o[q + 1] = -o[q + 1]
		jk += [q + 1]
if o[n - 1] != -1:
	m = 1
if m == 1 and g == 1:
	print(-1)
if m != 1 and g == 1:
	print(len(jk))
	for ty in jk:
		print(ty, end=' ')
if m == 1 and g != 1:
	print(len(l))
	for tyh in l:
		print(tyh, end=' ')
if m != 1 and g != 1:
	if len(l) < len(jk):
		print(len(l))
		for tye in l:
			print(tye, end=' ')
	else:
		print(len(jk))
		for tyw in jk:
			print(tyw, end=' ')


def check(target, a):
	return target ^ 1 not in a
n = int(input())
a = [0 if ch == 'W' else 1 for ch in input()]
for target in (0, 1):
	ret = []
	t = a[:]
	for i in range(n - 2):
		sub = t[i:i + 3]
		if sub == [target, target ^ 1, target ^ 1]:
			ret.append(i + 2)
			t[i + 1] = t[i + 2] = target
		elif sub == [target ^ 1, target ^ 1, target]:
			ret.append(i + 1)
			t[i] = t[i + 1] = target
		elif sub == [target ^ 1, target, target ^ 1]:
			ret.extend([i + 1, i + 2])
			t[i] = t[i + 2] = target
		elif sub == [target ^ 1] * 3:
			ret.append(i + 1)
			t[i] = t[i + 1] = target
		elif sub == [target, target ^ 1, target]:
			ret.append(i + 2)
			t[i + 1] = target
			t[i + 2] = target ^ 1
	if check(target, t):
		print(len(ret))
		print(*ret)
		exit()
print(-1)


n = int(input())
f = list(str(input()))
s = f * 1
i = 0
b = []
w = []
while i < n - 1:
	if s[i] == 'B' and s[i + 1] == 'B':
		b.append(i + 1)
		s[i] = 'W'
		s[i + 1] = 'W'
		i += 2
	elif s[i] == 'B' and s[i + 1] == 'W':
		b.append(i + 1)
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		i += 1
	else:
		i += 1
if s.count('B') != 0:
	b = [9] * 10 ** 5
s = f * 1
i = 0
while i < n - 1:
	if s[i] == 'W' and s[i + 1] == 'W':
		w.append(i + 1)
		s[i] = 'B'
		s[i + 1] = 'B'
		i += 2
	elif s[i] == 'W' and s[i + 1] == 'B':
		w.append(i + 1)
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		i += 1
	else:
		i += 1
if s.count('W') != 0:
	w = [9] * 10 ** 5
if len(b) * len(w) == 10 ** 10:
	print(-1)
elif len(b) * len(w) == 0:
	print(0)
else:
	print(min(len(b), len(w)))
	if len(b) < len(w):
		for j in range(len(b)):
			print(b[j], end=' ')
	else:
		for j in range(len(w)):
			print(w[j], end=' ')


n = int(input())
l = list(input())
b = 0
w = 0
for i in l:
	if i == 'B':
		b += 1
	else:
		w += 1
if b % 2 == w % 2 == 1:
	print(-1)
elif b == n or w == n:
	print(0)
else:
	ans = []
	s = l
	if w % 2 == 0:
		for i in range(n - 1):
			if s[i] == 'W':
				if s[i + 1] == 'B':
					ans.append(i + 1)
					s[i + 1] = 'W'
				elif s[i + 1] == 'W':
					s[i + 1] = 'B'
					ans.append(i + 1)
		print(len(ans))
		print(*ans)
	else:
		for i in range(n - 1):
			if s[i] == 'B':
				if s[i + 1] == 'W':
					ans.append(i + 1)
					s[i + 1] = 'B'
				elif s[i + 1] == 'B':
					s[i + 1] = 'W'
					ans.append(i + 1)
		print(len(ans))
		print(*ans)


n = int(input())
l = [int(c == 'B') for c in input()]
res = []
for e in [1, 0]:
	for i in range(n - 1):
		if l[i] == e:
			l[i] ^= 1
			l[i + 1] ^= 1
			res.append(i + 1)
	if sum(l) == (e ^ 1) * n:
		print(len(res))
		print(*res, sep=' ')
		exit(0)
print(-1)


n = int(input())
s = list(input())
w = s.count('W')
b = n - w
f = lambda c: 'B' if c == 'W' else 'W'
if not b & 1:
	l = []
	for i in range(n - 1):
		if s[i] == 'B':
			(s[i], s[i + 1]) = (f(s[i]), f(s[i + 1]))
			l.append(i + 1)
	le = len(l)
	print(le)
	if le:
		print(*l)
elif not w & 1:
	l = []
	for i in range(n - 1):
		if s[i] == 'W':
			(s[i], s[i + 1]) = (f(s[i]), f(s[i + 1]))
			l.append(i + 1)
	le = len(l)
	print(le)
	if le:
		print(*l)
else:
	print(-1)


import sys
import collections
import heapq
import math
import bisect
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rstr():
	return input().strip()

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = rint()
s = [i for i in rstr()]
ans = []
counts = collections.Counter(s)
for i in range(n):
	if i + 1 < n:
		if s[i] == 'B' and s[i + 1] == 'W':
			(s[i], s[i + 1]) = ('W', 'B')
			ans.append(i)
		elif s[i] == 'B' and s[i + 1] == 'B':
			(s[i], s[i + 1]) = ('W', 'W')
			ans.append(i)
if s[-1] == 'B':
	for i in range(0, n - 1, 2):
		if s[i] == 'W' and i + 2 < n:
			(s[i], s[i + 1]) = ('B', 'B')
			ans.append(i)
cnts = collections.Counter(s)
if cnts['B'] != n and cnts['W'] != n:
	print(-1)
	exit()
print(len(ans))
print(' '.join([str(i + 1) for i in ans]))


a = int(input())
b = input()
sum = 0
line = []
for i in range(a):
	if b[i] == 'B':
		sum += 1
		line.append(1)
	else:
		line.append(0)
if sum % 2 == a % 2:
	ans = []
	if a % 2 == 1:
		for i in range(a - 1):
			if line[i] == 0:
				line[i] = 1
				line[i + 1] = abs(line[i + 1] - 1)
				ans.append(i + 1)
		for i in range(1, a, -1):
			if line[i] == 0:
				line[i] = 1
				line[i + 1] = abs(line[i + 1] - 1)
				ans.append(i + 1)
	else:
		for i in range(a - 1):
			if line[i] == 1:
				line[i] = 0
				line[i + 1] = abs(line[i + 1] - 1)
				ans.append(i + 1)
		for i in range(1, a, -1):
			if line[i] == 1:
				line[i] = 0
				line[i + 1] = abs(line[i + 1] - 1)
				ans.append(i + 1)
	print(len(ans))
	print(*ans)
elif sum % 2 == 0 and a % 2 == 1:
	ans = []
	for i in range(a - 1):
		if line[i] == 1:
			line[i] = 0
			line[i + 1] = abs(line[i + 1] - 1)
			ans.append(i + 1)
		for i in range(1, a, -1):
			if line[i] == 1:
				line[i] = 0
				line[i + 1] = abs(line[i + 1] - 1)
				ans.append(i + 1)
	print(len(ans))
	print(*ans)
else:
	print(-1)


n = int(input())
a = [0] * n
cnt = [0, 0]
for (i, v) in enumerate(input()):
	if v == 'B':
		a[i] = 1
		cnt[1] += 1
	else:
		a[i] = 0
		cnt[0] += 1
if cnt[0] % 2 == 1 and 1 == cnt[1] % 2:
	print(-1)
else:
	total = 0
	ans = []
	for i in range(n - 1):
		if a[i] == 0:
			total += 1
			ans.append(i + 1)
			a[i] = 1
			if a[i + 1] == 1:
				a[i + 1] = 0
			else:
				a[i + 1] = 1
	cnt1 = a.count(1)
	cnt0 = a.count(0)
	if cnt0 > 0 and cnt1 % 2 == 0:
		total += cnt1 // 2
		for i in range(1, cnt1 + 1, 2):
			ans.append(i)
	print(total)
	for i in ans:
		print(i, end=' ')


import sys
ilo = int(input())
kloc = list(input())
iloW = 0
iloB = 0
kol = 'W'
iloZ = 0
zmia = ''
for i in range(ilo):
	if kloc[i] == 'W':
		iloW += 1
	else:
		iloB += 1
if iloW == ilo:
	print(0)
	sys.exit()
elif iloB == ilo:
	print(0)
	sys.exit()
if iloW % 2 == 1 and iloB % 2 == 1:
	print(-1)
	sys.exit()
if iloB % 2 == 1:
	kol = 'B'
for i in range(ilo - 1):
	if kloc[i] != kol:
		iloZ += 1
		zmia += str(i + 1) + ' '
		kloc[i] = kol
		if kloc[i + 1] == 'B':
			kloc[i + 1] = 'W'
		else:
			kloc[i + 1] = 'B'
print(iloZ)
print(zmia)


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	n = inin()
	s = sin()
	a = []
	j = k = 0
	for i in s:
		if i == 'W':
			a.append(1)
			j += 1
		else:
			a.append(0)
			k += 1
	ans = []
	if j % 2 == 1 and k % 2 == 1:
		print(-1)
	else:
		for i in range(1, n - 1):
			if a[i] != a[i - 1]:
				ans.append(i + 1)
				a[i] ^= 1
				a[i + 1] ^= 1
		for i in range(n - 2, 0, -1):
			if a[i] != a[i + 1]:
				ans.append(i)
				a[i] ^= 1
				a[i - 1] ^= 1
		print(len(ans))
		if len(ans) > 0:
			print(*ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


import sys

def rev(s):
	if s == 'W':
		return 'B'
	else:
		return 'W'
n = int(input())
p = list(input())
w = 0
b = 0
for i in p:
	if i == 'B':
		b += 1
	else:
		w += 1
if w % 2 == 1 and b % 2 == 1:
	print(-1)
	sys.exit()
if b % 2 == 1:
	ans = []
	for i in range(n - 1):
		if p[i] == 'W':
			ans.append(i + 1)
			p[i + 1] = rev(p[i + 1])
else:
	ans = []
	for i in range(n - 1):
		if p[i] == 'B':
			ans.append(i + 1)
			p[i + 1] = rev(p[i + 1])
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
bk = list(input())
if bk.count('W') % 2 == 1 and bk.count('B') % 2 == 1:
	print(-1)
else:
	ans = []
	if bk.count('W') % 2 == 0 and bk.count('B') % 2 == 0:
		if bk.count('W') > bk.count('B'):
			c = 'W'
		else:
			c = 'B'
	elif bk.count('W') % 2 == 0:
		c = 'B'
	else:
		c = 'W'
	for i in range(n - 1):
		if bk[i] != c:
			ans.append(i + 1)
			if bk[i] == 'W':
				bk[i] = 'B'
			else:
				bk[i] = 'W'
			if bk[i + 1] == 'W':
				bk[i + 1] = 'B'
			else:
				bk[i + 1] = 'W'
	print(len(ans))
	print(*ans)


i1 = int(input())
ar = list(input())
if ar.count('W') % 2 != 0 and ar.count('B') % 2 != 0:
	print(-1)
else:
	if ar.count('W') % 2 == 0:
		count = 0
		swap = []
		for i in range(len(ar) - 1):
			if ar[i] == 'W' and ar[i + 1] == 'W':
				count += 1
				swap.append(str(i + 1))
				ar[i] = 'B'
				ar[i + 1] = 'B'
			elif ar[i] == 'W' and ar[i + 1] == 'B':
				ar[i] = 'B'
				ar[i + 1] = 'W'
				count += 1
				swap.append(str(i + 1))
	elif ar.count('B') % 2 == 0:
		count = 0
		swap = []
		for i in range(len(ar) - 1):
			if ar[i] == 'B' and ar[i + 1] == 'B':
				count += 1
				swap.append(str(i + 1))
				ar[i] = 'W'
				ar[i + 1] = 'W'
			elif ar[i] == 'B' and ar[i + 1] == 'W':
				ar[i] = 'W'
				ar[i + 1] = 'B'
				count += 1
				swap.append(str(i + 1))
	print(count)
	print(' '.join(swap))


n = int(input())
s = input()
if s.count('W') % 2 == 1 and s.count('B') % 2 == 1:
	print(-1)
	exit()
l = []
for i in range(n):
	l.append(s[i])
if l.count('W') % 2 == 1:
	t = 'B'
	t1 = 'W'
else:
	t = 'W'
	t1 = 'B'
ans = []
for i in range(n - 1):
	if t == 'B' and l[i] == 'B':
		l[i] = 'W'
		if l[i + 1] == 'B':
			l[i + 1] = 'W'
		else:
			l[i + 1] = 'B'
		ans.append(i + 1)
	elif t == 'W' and l[i] == 'W':
		l[i] = 'B'
		if l[i + 1] == 'B':
			l[i + 1] = 'W'
		else:
			l[i + 1] = 'B'
		ans.append(i + 1)
print(len(ans))
print(*ans)


n = int(input())
stri = input()
stringa = []
for i in range(len(stri)):
	stringa.append(stri[i])
counta = 0
countb = 0
for i in range(len(stringa)):
	if stringa[i] == 'W':
		counta += 1
	else:
		countb += 1
if counta % 2 == 1 and countb % 2 == 1:
	print(-1)
elif counta == n or countb == n:
	print(0)
else:
	if counta % 2 == 0:
		ans = []
		for i in range(len(stringa) - 1):
			if stringa[i] == 'W':
				ans.append(i)
				if stringa[i + 1] == 'W':
					stringa[i + 1] = 'B'
				else:
					stringa[i + 1] = 'W'
	elif countb % 2 == 0:
		ans = []
		for i in range(len(stringa) - 1):
			if stringa[i] == 'B':
				ans.append(i)
				if stringa[i + 1] == 'W':
					stringa[i + 1] = 'B'
				else:
					stringa[i + 1] = 'W'
	for i in range(len(ans)):
		ans[i] = ans[i] + 1
	print(len(ans))
	print(*ans)


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input().strip()
mod = 1000000007

def swap(a):
	if a == 'W':
		return 'B'
	return 'W'
n = I()
s = S()
s = list(s)
t = s.copy()
ans = []
ans1 = []
f = 0
g = 0
for i in range(0, n - 1):
	if s[i] == 'B':
		s[i] = 'W'
		s[i + 1] = swap(s[i + 1])
		ans.append(i + 1)
if s[n - 1] == 'W':
	f = 1
for i in range(0, n - 1):
	if t[i] == 'W':
		t[i] = 'B'
		t[i + 1] = swap(t[i + 1])
		ans1.append(i + 1)
if t[n - 1] == 'B':
	g = 1
if f:
	print(len(ans))
	if len(ans):
		print(*ans)
elif g:
	print(len(ans1))
	if len(ans1):
		print(*ans1)
else:
	print(-1)


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def change(s, i):
	if s[i] == 'W':
		s[i] = 'B'
	else:
		s[i] = 'W'

def check(s, c):
	r = []
	for i in range(len(s) - 1):
		if s[i] != c:
			r.append(i + 1)
			change(s, i)
			change(s, i + 1)
	if s == [c] * len(s):
		return r
	else:
		return None
n = mint()
s = list(minp())
r = check(s.copy(), 'B')
if r == None:
	r = check(s.copy(), 'W')
if r != None:
	print(len(r))
	print(*r)
else:
	print(-1)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def allblack(s, n, w):
	i = 0
	ans = []
	while i < n - 1:
		if s[i] == 'W':
			if s[i + 1] == 'W':
				ans.append(i + 1)
				w -= 2
				i += 2
			else:
				ans.append(i + 1)
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				i += 1
		elif s[i + 1] == 'B':
			i += 2
		else:
			i += 1
	if w == 0:
		return ans
	else:
		return [-1]

def allwhite(s, n, b):
	i = 0
	ans = []
	while i < n - 1:
		if s[i] == 'B':
			if s[i + 1] == 'B':
				ans.append(i + 1)
				b -= 2
				i += 2
			else:
				ans.append(i + 1)
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				i += 1
		elif s[i + 1] == 'W':
			i += 2
		else:
			i += 1
	if b == 0:
		return ans
	else:
		return [-1]

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	zz = 0
	for _ in range(1):
		n = ri()
		s = rs()
		(b, w) = (0, 0)
		a = ['.'] * n
		for i in range(n):
			if s[i] == 'B':
				b += 1
				a[i] = 'B'
			else:
				w += 1
				a[i] = 'W'
		if b == n or w == n:
			print(0)
		else:
			aa = a.copy()
			ab = a.copy()
			aw = allwhite(aa, n, b)
			ab = allblack(ab, n, w)
			if aw[0] != -1:
				print(len(aw))
				print(*aw)
			elif ab[0] != -1:
				print(len(ab))
				print(*ab)
			else:
				print(-1)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


n = int(input())
s = input()
w = s.count('W')
b = n - w
if b % 2 == w % 2 == 1:
	print(-1)
else:
	c = 0
	p = 0
	ans = []
	x = 'W' if w % 2 == 0 else 'B'
	for i in range(n):
		if s[i] == x and p == 0 or (s[i] != x and p == 1):
			p = 1
			c += 1
			ans.append(i + 1)
		else:
			p = 0
	print(c)
	print(*ans)


b = []
w = []
v = []
n = int(input())
x = input()
for i in range(n):
	if x[i] == 'B':
		b += (i + 1,)
	else:
		w += (i + 1,)
(lb, lw) = (len(b), len(w))
if lb % 2 + lw % 2 == 2:
	print(-1)
else:
	if lb % 2:
		(b, w, lb, lw) = (w, b, lw, lb)
	for i in range(1, lb, 2):
		v.extend([i for i in range(b[i] - 1, b[i - 1], -1)])
		v += (b[i - 1],)
	print(len(v))
	print(*v)


import sys, copy
n = int(sys.stdin.readline())
arr = list(sys.stdin.readline().rstrip())
btemp = copy.deepcopy(arr)
wtemp = copy.deepcopy(arr)
b2w = []
w2b = []
for i in range(n - 1):
	if btemp[i] == 'B':
		btemp[i] = 'W'
		if btemp[i + 1] == 'B':
			btemp[i + 1] = 'W'
		else:
			btemp[i + 1] = 'B'
		b2w.append(i + 1)
for i in range(n - 1):
	if wtemp[i] == 'W':
		wtemp[i] = 'B'
		if wtemp[i + 1] == 'B':
			wtemp[i + 1] = 'W'
		else:
			wtemp[i + 1] = 'B'
		w2b.append(i + 1)
bcan = False
if len(set(btemp)) == 1:
	bcan = True
wcan = False
if len(set(wtemp)) == 1:
	wcan = True
if bcan:
	print(len(b2w))
	print(' '.join(map(str, b2w)))
elif wcan:
	print(len(w2b))
	print(' '.join(map(str, w2b)))
else:
	print(-1)


n = int(input())
x = input()
numW = 0
outlist = []
num = 0
for letter in x:
	if letter == 'W':
		numW += 1
if numW % 2 == 1 and len(x) % 2 == 1:
	t = 0
	while t < len(x):
		if x[t] == 'B':
			outlist.append(t + 1)
			num += 1
			if x[t + 1] == 'W':
				x = x[:t] + 'WB' + x[t + 2:]
				t += 1
			else:
				x = x[:t] + 'WW' + x[t + 2:]
				t += 2
		else:
			t += 1
elif numW % 2 == 1 and len(x) % 2 == 0:
	print('-1')
	quit()
else:
	t = 0
	while t < len(x):
		if x[t] == 'W':
			outlist.append(t + 1)
			num += 1
			if x[t + 1] == 'W':
				x = x[:t] + 'BB' + x[t + 2:]
				t += 2
			else:
				x = x[:t] + 'BW' + x[t + 2:]
				t += 1
		else:
			t += 1
print(str(num))
for j in range(len(outlist)):
	outlist[j] = str(outlist[j])
print(' '.join(outlist))


def inpu():
	return input().split(' ')

def inti(a):
	for i in range(len(a)):
		a[i] = int(a[i])
	return a

def inp():
	a = inpu()
	a = inti(a)
	return a
n = int(input())
a = input()
b = 0
w = 0
for i in range(n):
	if a[i] == 'W':
		w += 1
	else:
		b += 1
if b == 0 or w == 0:
	print(0)
	exit(0)
if b % 2 == 0:
	ans = []
	i = 0
	while i < n:
		firstblack = -1
		while i < n - 1:
			if a[i] == 'B':
				firstblack = i
				break
			i += 1
		if i >= n - 1:
			break
		secondblack = -1
		ans.append(i)
		i += 1
		while i < n:
			if a[i] == 'B':
				secondblack = i
				break
			ans.append(i)
			i += 1
		i += 1
	print(len(ans))
	for i in ans:
		print(i + 1, end=' ')
elif w % 2 == 0:
	ans = []
	i = 0
	while i < n:
		firstblack = -1
		while i < n - 1:
			if a[i] == 'W':
				firstblack = i
				break
			i += 1
		if i >= n - 1:
			break
		secondblack = -1
		ans.append(i)
		i += 1
		while i < n:
			if a[i] == 'W':
				secondblack = i
				break
			ans.append(i)
			i += 1
		i += 1
	print(len(ans))
	for i in ans:
		print(i + 1, end=' ')
else:
	print(-1)


n = int(input())
s = input()
x = s.count('B')
y = s.count('W')
if x == 0 or y == 0:
	print(0)
else:
	B = list(s)
	A = []
	for i in range(n - 1):
		if B[i] == 'B':
			B[i] = 'W'
			A.append(i + 1)
			if B[i + 1] == 'B':
				B[i + 1] = 'W'
			else:
				B[i + 1] = 'B'
	if B.count('B') == 0:
		print(len(A))
		print(*A)
	else:
		for i in range(n - 1):
			if B[i] == 'W':
				B[i] = 'B'
				A.append(i + 1)
				if B[i + 1] == 'W':
					B[i + 1] = 'B'
				else:
					B[i + 1] = 'W'
		if B.count('W') == 0:
			print(len(A))
			print(*A)
		else:
			for i in range(n - 1):
				if B[i] == 'B':
					B[i] = 'W'
					A.append(i + 1)
					if B[i + 1] == 'B':
						B[i + 1] = 'W'
					else:
						B[i + 1] = 'B'
			if B.count('B') == 0:
				print(len(A))
				print(*A)
			else:
				print(-1)


n = int(input())
s = input()
(noB, noW) = (0, 0)
for i in s:
	if i == 'B':
		noB += 1
	else:
		noW += 1
if noW % 2 == 1 and noB % 2 == 1:
	print(-1)
elif noB == 0 or noW == 0:
	print(0)
elif noW % 2 == 0 and noB % 2 == 1:
	li = []
	ans = []
	count = 0
	for i in range(len(s)):
		if s[i] == 'W':
			li.append(i)
	for i in range(int(len(li) / 2)):
		a = li[2 * i]
		b = li[2 * i + 1]
		for j in range(a + 1, b + 1):
			ans.append(str(j))
			count += 1
	print(count)
	u = ' '.join(ans)
	print(u)
elif noW % 2 == 1 and noB % 2 == 0 or (noW % 2 == 0 and noB % 2 == 0):
	li = []
	ans = []
	count = 0
	for i in range(len(s)):
		if s[i] == 'B':
			li.append(i)
	for i in range(int(len(li) / 2)):
		a = li[2 * i]
		b = li[2 * i + 1]
		for j in range(a + 1, b + 1):
			ans.append(str(j))
			count += 1
	print(count)
	u = ' '.join(ans)
	print(u)


n = int(input())
s = input()
t = list(s)
blm = 0
bll = []
blp = 1
for i in range(len(t)):
	if t[i] == 'W':
		if i != len(t) - 1:
			t[i] = 'B'
			if t[i + 1] == 'W':
				t[i + 1] = 'B'
			else:
				t[i + 1] = 'W'
			blm = blm + 1
			bll.append(i + 1)
		else:
			blp = 0
t = list(s)
wlm = 0
wll = []
wlp = 1
for i in range(len(t)):
	if t[i] == 'B':
		if i != len(t) - 1:
			t[i] = 'W'
			if t[i + 1] == 'B':
				t[i + 1] = 'W'
			else:
				t[i + 1] = 'B'
			wlm = wlm + 1
			wll.append(i + 1)
		else:
			wlp = 0
if wlp == 0 and blp == 0:
	print(-1)
else:
	if blm < wlm and blp == 1:
		print(blm)
		x = ''
		for i in bll:
			x = x + str(i) + ' '
	elif wlp == 1:
		print(wlm)
		x = ''
		for i in wll:
			x = x + str(i) + ' '
	else:
		print(blm)
		x = ''
		for i in bll:
			x = x + str(i) + ' '
	print(x)


n = int(input())
s = input()
a = []
symbol = 'B'
anti = 'W'
if s.count('B') % 2:
	if s.count('W') % 2:
		print('-1')
		exit()
	else:
		symbol = 'W'
		anti = 'B'
s = list(s)
for i in range(len(s) - 1):
	if s[i] == symbol:
		s[i + 1] = symbol if s[i + 1] != symbol else anti
		a.append(i + 1)
print(len(a), '\n', *a)


def check(arr):
	ans = []
	for i in range(len(arr) - 1):
		if arr[i] == 'W':
			continue
		else:
			ans.append(i + 1)
			arr[i] = 'W'
			if arr[i + 1] == 'W':
				arr[i + 1] = 'B'
			else:
				arr[i + 1] = 'W'
	if len(set(arr)) == 1:
		return ans
	else:
		return -1

def check1(arr1):
	ans1 = []
	for i in range(len(arr1) - 1):
		if arr1[i] == 'B':
			continue
		else:
			ans1.append(i + 1)
			arr1[i] = 'B'
			if arr1[i + 1] == 'B':
				arr1[i + 1] = 'W'
			else:
				arr1[i + 1] = 'B'
	if len(set(arr1)) == 1:
		return ans1
	else:
		return -1
n = int(input())
s = input()
arr = list(s)
arr1 = list(s)
a = check(arr)
b = check1(arr1)
if a != -1:
	print(len(a))
	print(*a, sep=' ')
elif b != -1:
	print(len(b))
	print(*b, sep=' ')
else:
	print(-1)


n = int(input())
p = list((1 if i == 'B' else 0 for i in input()))
q = p[:]
c = []
d = []
for i in range(n - 1):
	if p[i] == 0:
		p[i] = 1
		p[i + 1] = 1 - p[i + 1]
		c.append(i + 1)
	if q[i] == 1:
		q[i] = 0
		q[i + 1] = 1 - q[i + 1]
		d.append(i + 1)
if sum(p) == n:
	print(len(c))
	print(*c)
elif sum(q) == 0:
	print(len(d))
	print(*d)
else:
	print(-1)


num = int(input())
string = input()

def count(string):
	Black = 0
	White = 0
	for char in string:
		if char == 'B':
			Black += 1
		else:
			White += 1
	return (Black, White)

def Make(mylist, color):
	retlist = []
	if color == 'B':
		for index in range(0, len(mylist) - 1):
			if not mylist[index] == 'B':
				mylist[index] = 'B'
				retlist.append(index)
				if mylist[index + 1] == 'B':
					mylist[index + 1] = 'W'
				else:
					mylist[index + 1] = 'B'
	else:
		for index in range(0, len(mylist) - 1):
			if not mylist[index] == 'W':
				mylist[index] = 'W'
				retlist.append(index)
				if mylist[index + 1] == 'B':
					mylist[index + 1] = 'W'
				else:
					mylist[index + 1] = 'B'
	return retlist
mylist = list(string)
mytuple = count(mylist)
if mytuple[0] % 2 != 0 and mytuple[1] % 2 != 0:
	print(-1)
elif mytuple[0] % 2 == 0:
	retlist = Make(mylist, 'W')
	print(len(retlist))
	for char in retlist:
		print(char + 1, end=' ')
else:
	retlist = Make(mylist, 'B')
	print(len(retlist))
	for char in retlist:
		print(char + 1, end=' ')


n = int(input())
st = input()
(w, b) = ([], [])
ans = []
for i in range(n):
	if st[i] == 'W':
		w.append(i)
	else:
		b.append(i)
if len(w) == 0 or len(b) == 0:
	print(0)
elif len(w) % 2 != 0 and len(b) % 2 != 0:
	print(-1)
elif len(w) % 2 == 0:
	ans = 0
	for i in range(0, len(w), 2):
		ans += w[i + 1] - w[i]
	print(ans)
	for i in range(0, len(w), 2):
		for j in range(w[i + 1], w[i], -1):
			print(j, end=' ')
elif len(b) % 2 == 0:
	ans = 0
	for i in range(0, len(b), 2):
		ans += b[i + 1] - b[i]
	print(ans)
	for i in range(0, len(b), 2):
		for j in range(b[i + 1], b[i], -1):
			print(j, end=' ')


n = int(input())
blocks = list(input())
b = blocks.count('B')
w = blocks.count('W')
if b * w == 0:
	print(0)
elif b * w % 2 == 1:
	print(-1)
else:
	l1 = []
	if b % 2 == 0:
		for i in range(n - 1):
			if blocks[i] == 'B':
				blocks[i] = 'W'
				if blocks[i + 1] == 'B':
					blocks[i + 1] = 'W'
				else:
					blocks[i + 1] = 'B'
				l1.append(str(i + 1))
	else:
		for i in range(n - 1):
			if blocks[i] == 'W':
				blocks[i] = 'B'
				if blocks[i + 1] == 'B':
					blocks[i + 1] = 'W'
				else:
					blocks[i + 1] = 'B'
				l1.append(str(i + 1))
	print(len(l1))
	print(' '.join(l1))


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	N = int(input())
	S = input()
	(bn, wn) = (S.count('B'), S.count('W'))
	if bn % 2 and wn % 2:
		print(-1)
		return
	if not bn % 2:
		color = ('B', 'W')
	if not wn % 2:
		color = ('W', 'B')
	s = list(S)
	ans = []
	for i in range(N - 1):
		if s[i] == color[0]:
			ans.append(i + 1)
			s[i] = 'B' if s[i] == 'W' else 'W'
			s[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
	print(len(ans))
	if len(ans):
		print(*ans)
main()


n = int(input(''))
a = input('')
p = []
for i in range(n):
	if a[i] == 'B':
		p.append(0)
	else:
		p.append(1)
fin = []
i = 0
while i < n - 1:
	if p[i] != p[i + 1] and p[i] == 1:
		fin.append(i)
		p[i] = 0
		p[i + 1] = 1
	if p[i] == p[i + 1] and p[i] == 1:
		p[i] = 0
		p[i + 1] = 0
		fin.append(i)
		i += 1
	i += 1
o = 0
z = 0
for i in range(n):
	if p[i] == 0:
		z += 1
	else:
		o += 1
res = True
if o == 1 and z % 2 != 0:
	print(-1)
	res = False
elif o == 1 and z % 2 == 0:
	for i in range(z // 2):
		fin.append(2 * i)
if res:
	print(len(fin))
	for h in fin:
		print(h + 1, end=' ')
print('')


n = int(input())
s = list(input())
count = 0
ans = []
while count <= n * 3:
	for i in range(n - 1):
		if s[i] != 'B':
			ans.append(i + 1)
			count += 1
			s[i] = 'B'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
	if 'W' not in s:
		print(count)
		if ans:
			print(*ans)
		exit()
	elif count > n * 3:
		print(-1)
		exit()
	for i in range(n - 1):
		if s[i] != 'W':
			ans.append(i + 1)
			count += 1
			s[i] = 'W'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
	if 'B' not in s:
		print(count)
		if ans:
			print(*ans)
		exit()
	elif count > n * 3:
		print(-1)
		exit()


n = int(input())
s = input()
l = []
for i in s:
	l.append(i)
ci = []
if l.count('B') % 2 == 0:
	for i in range(n - 1):
		if l[i] == 'B':
			ci.append(i)
			l[i] = 'W'
			if l[i + 1] == 'W':
				l[i + 1] = 'B'
			else:
				l[i + 1] = 'W'
	print(len(ci))
	for i in ci:
		print(i + 1, end=' ')
	print()
elif l.count('W') % 2 == 0:
	for i in range(n - 1):
		if l[i] == 'W':
			ci.append(i)
			l[i] = 'B'
			if l[i + 1] == 'B':
				l[i + 1] = 'W'
			else:
				l[i + 1] = 'B'
	print(len(ci))
	for i in ci:
		print(i + 1, end=' ')
	print()
else:
	print(-1)


fl = []

def minKBitFlips(A, K):
	global fl
	N = len(A)
	hint = [0] * N
	ans = flip = 0
	for (i, x) in enumerate(A):
		flip ^= hint[i]
		if x ^ flip == 0:
			ans += 1
			fl.append(i + 1)
			if i + K > N:
				return -1
			flip ^= 1
			if i + K < N:
				hint[i + K] ^= 1
	return ans
n = int(input())
s = input()
a = []
for i in range(0, n):
	if s[i] == 'B':
		a.append(1)
	else:
		a.append(0)
ans = minKBitFlips(a, 2)
if ans == -1:
	fl = []
	a = [1 - i for i in a]
	ans2 = minKBitFlips(a, 2)
	if ans2 == -1:
		print(-1)
	else:
		print(ans2)
		print(*fl)
else:
	print(ans)
	print(*fl)


import math
import sys
input = sys.stdin.readline
R = lambda : list(map(int, input().split()))
n = int(input())
s = input()
w = s.count('W')
b = n - w
if b % 2 == w % 2 == 1:
	print(-1)
else:
	c = 0
	p = 0
	ans = []
	x = 'W' if w % 2 == 0 else 'B'
	for i in range(n):
		if s[i] == x and p == 0 or (s[i] != x and p == 1):
			p = 1
			c += 1
			ans.append(i + 1)
		else:
			p = 0
	print(c)
	print(*ans)


n = int(input())
s = input()

def f(n, S, b):
	s = [b] + [i == 'W' for i in S]
	ops = []
	for i in range(1, n):
		if s[i] != s[i - 1]:
			ops.append(i)
			s[i] = not s[i]
			s[i + 1] = not s[i + 1]
	if (not s[0]) in s:
		return False
	else:
		print(len(ops))
		for i in ops:
			print(i, end=' ')
		return True
if not (f(n, s, True) or f(n, s, False)):
	print(-1)


n = int(input())
string = input()
s = list(string)
counts = 0
arr = []
ans = ''
W_count = s.count('W')
B_count = s.count('B')
Ws = W_count % 2
Bs = B_count % 2
while True:
	if Ws == 1 and Bs == 1:
		print(-1)
		break
	if s.count('W') == 0 or s.count('B') == 0:
		print(counts)
		for x in arr:
			ans += str(x) + ' '
		print(ans)
		break
	elif Ws >= Bs:
		for (i, x) in enumerate(s):
			if x == 'B':
				s[i] = 'W'
				if i != len(s) - 1:
					s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
					counts += 1
					arr.append(i + 1)
	else:
		for (i, x) in enumerate(s):
			if x == 'W':
				s[i] = 'B'
				if i != len(s) - 1:
					s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
					counts += 1
					arr.append(i + 1)


import sys
import os
from io import BytesIO, IOBase

def cel(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
d = {'W': 'B', 'B': 'W'}
for _ in range(1):
	n = ii()
	a = input()
	s = list(a)
	f = 0
	res = []
	for i in range(n - 1):
		if s[i] == 'B':
			(s[i], s[i + 1]) = (d[s[i]], d[s[i + 1]])
			res.append(i + 1)
			i += 2
	if s[-1] == 'B':
		s = list(a)
		res = []
		for i in range(n - 1):
			if s[i] == 'W':
				(s[i], s[i + 1]) = (d[s[i]], d[s[i + 1]])
				res.append(i + 1)
		if s[-1] == 'W':
			f = 1
	if f == 0:
		if res:
			print(len(res))
			print(*res)
		else:
			print(0)
	else:
		print(-1)


import copy
a = int(input())
s = list(input())
n = len(s)
s2 = copy.deepcopy(s)
ans1 = []
for i in range(n - 1):
	if s[i] == 'W':
		None
	else:
		s[i] = 'B'
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		ans1.append(i + 1)
if s[n - 1] == 'W':
	print(len(ans1))
	print(*ans1, end=' ')
	print()
else:
	ans2 = []
	for i in range(n - 1):
		if s2[i] == 'B':
			None
		else:
			s2[i] = 'B'
			if s2[i + 1] == 'B':
				s2[i + 1] = 'W'
			else:
				s2[i + 1] = 'B'
			ans2.append(i + 1)
	if s2[n - 1] == 'B':
		print(len(ans2))
		print(*ans2, end=' ')
		print()
	else:
		print(-1)


def solve(n, a):
	w = a.count('W')
	b = a.count('B')
	if w == 0 or b == 0:
		return 0
	if w % 2 != 0 and b % 2 != 0:
		return -1
	ind = []
	ans = []
	indw = []
	for i in range(n):
		if a[i] == 'B':
			ind.append(i)
		if a[i] == 'W':
			indw.append(i)
	i = 0
	if b % 2 == 0:
		while i < b:
			ans += (int(x) for x in range(ind[i] + 1, ind[i + 1] + 1))
			i += 2
		return ans
	while i < w:
		ans += (int(x) for x in range(indw[i] + 1, indw[i + 1] + 1))
		i += 2
	return ans
n = int(input())
a = list(input())
p = solve(n, a)
if p == -1 or p == 0:
	print(p)
else:
	print(len(p))
	print(*p)


n = int(input())
string = list(input().strip())

def make_white(s):
	inverts = []
	for i in range(len(s) - 1):
		if s[i] == 'B':
			s[i] = 'W'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
			inverts.append(i + 1)
	if s[-1] == 'W':
		return (True, inverts)
	else:
		return (False, inverts)

def make_black(s):
	inverts = []
	for i in range(len(s) - 1):
		if s[i] == 'W':
			s[i] = 'B'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
			inverts.append(i + 1)
	if s[-1] == 'B':
		return (True, inverts)
	else:
		return (False, inverts)
(can, inv) = make_white(string[:])
if can:
	print(len(inv))
	print(' '.join(map(str, inv)))
else:
	(can2, inv2) = make_black(string[:])
	if can2:
		print(len(inv2))
		print(' '.join(map(str, inv2)))
	else:
		print(-1)


def main():
	n = int(input())
	bb = list(input())
	res = []
	for i in range(len(bb) - 1):
		if bb[i] == 'B':
			res.append(i + 1)
			bb[i] = 'W'
			bb[i + 1] = 'W' if bb[i + 1] == 'B' else 'B'
	if bb[-1] == 'W':
		print(len(res))
		if len(res) > 0:
			print(' '.join(map(str, res)))
		return
	for i in range(len(bb) - 1):
		if bb[i] == 'W':
			res.append(i + 1)
			bb[i] = 'B'
			bb[i + 1] = 'W' if bb[i + 1] == 'B' else 'B'
	if bb[-1] == 'B':
		print(len(res))
		if len(res) > 0:
			print(' '.join(map(str, res)))
		return
	print(-1)
main()


n = int(input())
s = list(input())
b = s.count('B')
w = n - b
if w % 2 == 1 and b % 2 == 1:
	print(-1)
else:
	ans = []
	if w % 2 == 1:
		odd = 'W'
		even = 'B'
	else:
		odd = 'B'
		even = 'W'
	for i in range(n - 1):
		if s[i] != odd:
			ans.append(i + 1)
			s[i] = odd
			s[i + 1] = even if s[i + 1] == odd else odd
	print(len(ans))
	print(*ans)


n = int(input())
s = input()
s = s.lower()
l = []
o = []
c = 0
c2 = 0
o2 = []
for i in s:
	l.append(i)
b = s.count('b')
w = s.count('w')
flag = 1
l2 = l[:]
if b % 2 != 0 and w % 2 != 0:
	print(-1)
	flag = 0
else:
	if b % 2 == 0:
		for i in range(len(l) - 1):
			if l[i] == 'b' and l[i + 1] == 'b':
				c += 1
				(l[i], l[i + 1]) = ('w', 'w')
				o.append(i)
			elif l[i] == 'b' and l[i + 1] == 'w':
				c += 1
				(l[i], l[i + 1]) = ('w', 'b')
				o.append(i)
	else:
		c = 99999999
	if w % 2 == 0:
		for i in range(len(l2) - 1):
			if l2[i] == 'w' and l2[i + 1] == 'w':
				c2 += 1
				(l2[i], l2[i + 1]) = ('b', 'b')
				o2.append(i)
			elif l2[i] == 'w' and l2[i + 1] == 'b':
				c2 += 1
				(l2[i], l2[i + 1]) = ('b', 'w')
				o2.append(i)
	else:
		c2 = 99999999
if flag != 0:
	if c < c2:
		print(c)
		for i in o:
			print(i + 1, end=' ')
	else:
		print(c2)
		for i in o2:
			print(i + 1, end=' ')


def main():
	n = int(input())
	line = input()
	b = 0
	w = 0
	pos = dict()
	pos['B'] = []
	pos['W'] = []
	for i in range(len(line)):
		if line[i] == 'B':
			b += 1
			pos['B'].append(i)
		else:
			pos['W'].append(i)
			w += 1
	if b % 2 == 1 and w % 2 == 1:
		print(-1)
		return 0
	else:
		if b % 2 == 0:
			key = 'B'
		else:
			key = 'W'
		line = list(line)
		to_print = ''
		lngth = 0
		for i in range(0, len(pos[key]), 2):
			for k in range(pos[key][i], pos[key][i + 1]):
				to_print += str(k + 1) + ' '
				lngth += 1
		print(lngth)
		print(to_print)
t = 1
for i in range(t):
	main()


n = int(input())
s = input()
b = 0
w = 0
for i in s:
	if i == 'W':
		w += 1
	else:
		b += 1
if w % 2 and b % 2:
	print(-1)
elif w % 2:
	a = [i for i in s]
	ans = []
	for i in range(n):
		if a[i] != 'W':
			ans.append(i + 1)
			if a[i + 1] == 'W':
				a[i + 1] = 'B'
			else:
				a[i + 1] = 'W'
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()
else:
	a = [i for i in s]
	ans = []
	for i in range(n):
		if a[i] != 'B':
			ans.append(i + 1)
			if a[i + 1] == 'W':
				a[i + 1] = 'B'
			else:
				a[i + 1] = 'W'
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()


from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
n = ii()
s = input()
s = list(s)
if s.count('B') % 2 == 1 and s.count('W') % 2 == 1:
	print(-1)
else:
	i = 0
	ans = []
	while i < n - 2:
		if s[i] != s[i + 1]:
			s[i + 1] = s[i]
			if s[i + 2] == 'B':
				s[i + 2] = 'W'
			else:
				s[i + 2] = 'B'
			ans.append(i + 2)
		i += 1
	if s.count('W') != n and s.count('B') != n:
		for i in range(0, n - 2, 2):
			ans.append(i + 1)
			if s[i] == 'W':
				s[i] = 'B'
				s[i + 1] = 'B'
			else:
				s[i] = 'W'
				s[i + 1] = 'W'
	print(len(ans))
	print(*ans)


from collections import deque

def solve():
	n = int(input())
	t = list(input())
	res = []
	if t.count(t[0]) == len(t):
		return '0\n'
	for i in range(len(t) - 1):
		if t[i] == 'B':
			t[i] = 'W'
			t[i + 1] = 'W' if t[i + 1] == 'B' else 'B'
			res.append(i + 1)
	if t[-1] == 'B':
		if len(t) % 2 == 0:
			return '-1\n'
		for i in range(0, len(t) - 2, 2):
			t[i] = t[i + 1] = 'B'
			res.append(i + 1)
	return f"{len(res)}\n{' '.join((str(a) for a in res))}"
print(solve())


n = int(input())
s = input()
s = list(s)
new = s.copy()
ans = ''
lst = []

def swap(a, b):
	if a == 'W':
		a = 'B'
	else:
		a = 'W'
	if b == 'W':
		b = 'B'
	else:
		b = 'W'
	return (a, b)
for i in range(len(s) - 1):
	if s[i] == 'B':
		(s[i], s[i + 1]) = swap(s[i], s[i + 1])
		lst.append(i)
	else:
		pass
if 'B' in s:
	s = new
	lst = []
	for i in range(len(s) - 1):
		if s[i] == 'W':
			(s[i], s[i + 1]) = swap(s[i], s[i + 1])
			lst.append(i)
		else:
			pass
	if 'W' in s:
		print(-1)
	else:
		print(len(lst))
		for a in lst:
			print(a + 1, end=' ')
else:
	print(len(lst))
	for a in lst:
		print(a + 1, end=' ')


n = int(input())
s = input()
b = 0
w = 0
for i in s:
	if i == 'B':
		b += 1
	else:
		w += 1
if b % 2 and w % 2:
	print(-1)
else:
	ch = 'W'
	if w % 2:
		ch = 'B'
	ans = []
	for i in range(n):
		if s[i] == ch:
			s = list(s)
			if s[i] == 'B':
				s[i] = 'W'
			else:
				s[i] = 'B'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			s = ''.join(s)
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


n = int(input())
s = input()
t = s
s = list(s)
ans = []
for i in range(n - 1):
	if s[i] == 'W':
		continue
	else:
		ans.append(i + 1)
		s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
if s[-1] == 'W':
	print(len(ans))
	print(*ans)
else:
	ans = []
	t = list(t)
	for i in range(n - 1):
		if t[i] == 'B':
			pass
		else:
			ans.append(i + 1)
			t[i + 1] = 'W' if t[i + 1] == 'B' else 'B'
	if t[-1] == 'B':
		print(len(ans))
		print(*ans)
	else:
		print(-1)


from math import sqrt
n = int(input())
s = [i for i in input()]
if s.count('W') % 2 and s.count('B') % 2:
	print(-1)
	exit()
else:
	i = 0
	ans = []
	if s.count('B') % 2 == 0:
		while i < n - 1:
			if s[i] == 'B':
				ans.append(i + 1)
				if s[i + 1] == 'W':
					s[i + 1] = 'B'
				else:
					s[i + 1] = 'W'
			i += 1
	else:
		i = 0
		ans = []
		while i < n - 1:
			if s[i] == 'W':
				ans.append(i + 1)
				if s[i + 1] == 'W':
					s[i + 1] = 'B'
				else:
					s[i + 1] = 'W'
			i += 1
	print(len(ans))
	if len(ans) != 0:
		print(*ans)


def func(s, l, c):
	if c == 'W':
		p = 'B'
	else:
		p = 'W'
	for i in range(n - 1):
		if s[i] == c:
			s[i] = p
			s[i + 1] = c if s[i + 1] == p else p
			l.append(i + 1)
	if len(set(s)) == 1:
		return l
	else:
		return []
(n, s) = (int(input()), list(input()))
(a, b) = (func(list(s), [], 'B'), func(list(s), [], 'W'))
if len(set(s)) == 1:
	print(0)
elif not a and (not b):
	print(-1)
else:
	print(*([len(a)] + a if not b else [len(b)] + b))


n = int(input())
a = list(input())
ops = list()

def opp(a):
	return 'B' if a == 'W' else 'W'
for i in range(n - 1):
	if a[i] == 'W':
		a[i] == 'B'
		a[i + 1] = opp(a[i + 1])
		ops.append(i + 1)
	else:
		continue
if a[n - 1] == 'B':
	print(len(ops))
	print(' '.join(map(str, ops)))
elif n % 2 == 0:
	print(-1)
else:
	ops.extend(list(range(1, n, 2)))
	print(len(ops))
	print(' '.join(map(str, ops)))


n = int(input())
s = input()
if s.count('W') % 2 == 1 and s.count('B') % 2 == 1:
	print(-1)
elif s.count('B') % 2 == 0:
	odp = []
	cur = list(s)
	for i in range(n - 1):
		if cur[i] != 'W':
			odp.append(i + 1)
			if cur[i + 1] == 'W':
				cur[i + 1] = 'B'
			else:
				cur[i + 1] = 'W'
	print(len(odp))
	print(*odp)
else:
	odp = []
	cur = list(s)
	for i in range(n - 1):
		if cur[i] != 'B':
			odp.append(i + 1)
			if cur[i + 1] == 'B':
				cur[i + 1] = 'W'
			else:
				cur[i + 1] = 'B'
	print(len(odp))
	print(*odp)


n = int(input())
s = input()
x = s.count('B')
y = s.count('W')
l = []
for i in s:
	if i == 'W':
		l.append(1)
	else:
		l.append(0)
if x & 1 and y & 1:
	print(-1)
	exit()
if x == 0 or y == 0:
	print(0)
	exit()
ans = []
for i in range(1, len(s) - 1):
	if l[i] != l[i - 1]:
		l[i] = not l[i]
		l[i + 1] = not l[i + 1]
		ans.append(i + 1)
x = l.count(0)
y = l.count(1)
for i in range(0, len(l), 2):
	if l[i] == x & 1:
		ans.append(i + 1)
print(len(ans))
print(*ans)


(n, s, l) = (int(input()), list(input()), [])
(w, b, default) = (s.count('W'), s.count('B'), 'B')
if w % 2 and b % 2:
	exit(print(-1))
elif w % 2:
	default = 'W'
for i in range(n - 1):
	if s[i] != s[i + 1] and s[i] != default:
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		l.append(i + 1)
	elif s[i] == s[i + 1] and s[i] != default:
		(s[i], s[i + 1]) = (default, default)
		l.append(i + 1)
print(len(l))
print(*l)


import sys
input = sys.stdin.readline
from collections import *
n = int(input())
S = list(input()[:-1])
if S in [['B'] * n, ['W'] * n]:
	print(0)
	exit()
(B, W) = (0, 0)
for Si in S:
	if Si == 'B':
		B += 1
	else:
		W += 1
if B % 2 == 1 and W % 2 == 1:
	print(-1)
	exit()
ans = []
if B % 2 == 0:
	l = []
	for i in range(n):
		if S[i] == 'B':
			l.append(i)
	for i in range(0, len(l), 2):
		s = l[i]
		t = l[i + 1]
		for i in range(s, t):
			ans.append(i)
else:
	l = []
	for i in range(n):
		if S[i] == 'W':
			l.append(i)
	for i in range(0, len(l), 2):
		s = l[i]
		t = l[i + 1]
		for i in range(s, t):
			ans.append(i)
print(len(ans))
print(*list(map(lambda x: x + 1, ans)))


n = int(input())
s = list(input())
dup_s = s[:]
i = 0
(a1, a2) = (list(), list())
while i < n:
	if s[i] == 'W':
		i += 1
		continue
	if i < n - 1:
		s[i] = 'W'
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		a1.append(i + 1)
	i += 1
i = 0
while i < n:
	if dup_s[i] == 'B':
		i += 1
		continue
	if i < n - 1:
		dup_s[i] = 'B'
		if dup_s[i + 1] == 'W':
			dup_s[i + 1] = 'B'
		else:
			dup_s[i + 1] = 'W'
		a2.append(i + 1)
	i += 1
if dup_s.count('B') == 0 or dup_s.count('B') == n:
	print(len(a2))
	print(*a2)
elif s.count('B') == 0 or s.count('B') == n:
	print(len(a1))
	print(*a1)
else:
	print(-1)


n = int(input())
inp = input()
blacks = inp.count('B')
whites = inp.count('W')
ansCount_ = 0
ansList = []
if blacks % 2 == 1 and whites % 2 == 1:
	print(-1)
else:
	if blacks % 2 == 1 and whites % 2 == 0:
		changeTo = 'W'
	elif blacks % 2 == 0 and whites % 2 == 1:
		changeTo = 'B'
	elif blacks > whites:
		changeTo = 'B'
	else:
		changeTo = 'W'
	for i in range(len(inp) - 1):
		if inp[i] == changeTo:
			inp = list(inp)
			if changeTo == 'B':
				inp[i] = 'W'
			else:
				inp[i] = 'B'
			if inp[i + 1] == 'B':
				inp[i + 1] = 'W'
			else:
				inp[i + 1] = 'B'
			inp = ''.join(inp)
			ansCount_ += 1
			ansList.append(i + 1)
	print(ansCount_)
	print(' '.join((str(i) for i in ansList)))


s = int(input())
s = input()
arr = []
ans = []
for i in range(len(s)):
	arr.append(s[i])
black = s.count('B')
white = s.count('W')
if black % 2 == white % 2 == 1:
	print('-1')
else:
	i = 0
	count = 0
	while i < len(arr) - 2:
		if arr[i] != arr[i + 1]:
			count = count + 1
			arr[i + 1] = arr[i]
			if arr[i + 2] == 'B':
				arr[i + 2] = 'W'
			else:
				arr[i + 2] = 'B'
			ans.append(i + 2)
		i = i + 1
	if arr.count('B') == 0 or arr.count('W') == 0:
		print(count)
		print(' '.join(map(str, ans)))
	else:
		count = count + len(s) // 2
		for i in range(len(s) // 2):
			ans.append(2 * i + 1)
		print(count)
		print(' '.join(map(str, ans)))


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7
n = iinput()
s = input()
cntb = s.count('B')
cntw = n - cntb
if cntb % 2 and cntw % 2:
	print(-1)
elif cntb % 2:
	whites = []
	for i in range(n):
		if s[i] == 'W':
			whites.append(i)
	ans = []
	for i in range(0, len(whites), 2):
		for j in range(whites[i], whites[i + 1]):
			ans.append(str(j + 1))
	print(len(ans))
	print(' '.join(ans))
elif cntw % 2:
	blacks = []
	for i in range(n):
		if s[i] == 'B':
			blacks.append(i)
	ans = []
	for i in range(0, len(blacks), 2):
		for j in range(blacks[i], blacks[i + 1]):
			ans.append(str(j + 1))
	print(len(ans))
	print(' '.join(ans))
else:
	whites = []
	for i in range(n):
		if s[i] == 'W':
			whites.append(i)
	ans = []
	for i in range(0, len(whites), 2):
		for j in range(whites[i], whites[i + 1]):
			ans.append(str(j + 1))
	print(len(ans))
	if len(ans) != 0:
		print(' '.join(ans))


n = int(input())
st = input()
s = list(st)
f = 0
if 'B' not in s or 'W' not in s:
	f = 1
li = []
for i in range(n - 1):
	if s[i] == 'B' and s[i + 1] == 'B':
		s[i] = 'W'
		s[i + 1] = 'W'
		li.append(i + 1)
	elif s[i] == 'B' and s[i + 1] == 'W':
		s[i] = 'W'
		s[i + 1] = 'B'
		li.append(i + 1)
if s[n - 1] == 'B':
	for i in range(n - 1):
		if s[i] == 'W' and s[i + 1] == 'W':
			s[i] = 'B'
			s[i + 1] = 'B'
			li.append(i + 1)
		elif s[i] == 'W' and s[i + 1] == 'B':
			s[i] = 'B'
			s[i + 1] = 'W'
			li.append(i + 1)
	if s[n - 1] == 'W' and (not f):
		print(-1)
	elif not f:
		print(len(li))
		print(*li)
	elif f:
		print(0)
elif not f:
	print(len(li))
	print(*li)
elif f:
	print(0)


import sys, math, bisect
from random import randint
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def primesInRange(n):
	ans = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans

def primeFactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n = n // i
	if n > 2:
		factors.append(n)
	return factors

def isPrime(n, k=5):
	if n < 2:
		return True
	for i in range(0, k):
		a = randint(1, n - 1)
		if pow(a, n - 1, n) != 1:
			return False
	return True
from collections import deque, defaultdict, Counter
import heapq, string
for _ in range(1):
	n = int(input())
	f = list(input())
	s = f[:]
	first = []
	second = []
	mp = {'B': 'W', 'W': 'B'}
	for i in range(n - 1):
		if f[i] == 'W':
			pass
		else:
			first.append(i + 1)
			f[i] = 'W'
			f[i + 1] = mp[f[i + 1]]
	if f[-1] == 'W':
		print(len(first))
		print(*first)
	else:
		for i in range(n - 1):
			if s[i] == 'B':
				pass
			else:
				second.append(i + 1)
				s[i] = 'B'
				s[i + 1] = mp[s[i + 1]]
		if s[-1] == 'B':
			print(len(second))
			print(*second)
		else:
			print(-1)


import os
import sys
from io import BytesIO, IOBase

def solution(s, n):
	if 'B' not in s or 'W' not in s:
		write(0)
		return
	(ss, res) = (list(s), [])
	for i in range(n - 1):
		if ss[i] == 'B':
			ss[i] = 'W'
			ss[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
			res.append(i + 1)
	if 'B' not in ss:
		write(len(res))
		write(*res)
		return
	(ss, res) = (list(s), [])
	for i in range(n - 1):
		if ss[i] == 'W':
			ss[i] = 'B'
			ss[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
			res.append(i + 1)
	if 'W' not in ss:
		write(len(res))
		write(*res)
		return
	write(-1)

def main():
	n = r_int()
	s = input()
	solution(s, n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


n = int(input())
s = input()
A = []
x = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		x += 1
if x == n - 1:
	print(0)
else:
	for i in range(n - 1):
		if s[i] == 'B':
			if s[i + 1] == 'B':
				s = s[:i] + 'WW' + s[i + 2:]
			else:
				s = s[:i] + 'WB' + s[i + 2:]
			A.append(i + 1)
	if s[-1] == 'B':
		for i in range(n - 1):
			if s[i] == 'W':
				if s[i + 1] == 'W':
					s = s[:i] + 'BB' + s[i + 2:]
				else:
					s = s[:i] + 'BW' + s[i + 2:]
				A.append(i + 1)
	y = 0
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print(-1)
			y += 1
			break
	if y == 0:
		print(len(A))
		for i in range(len(A)):
			print(A[i], end=' ')


import sys
reader = (line.rstrip() for line in sys.stdin)

def inversions(s, n):
	k = s.count('B')
	if k % 2 == 0:
		todel = 'B'
	elif n % 2 == 1:
		todel = 'W'
	else:
		return None
	a = [c == todel for c in s]
	ans = []
	for i in range(n - 1):
		if a[i]:
			a[i] = not a[i]
			a[i + 1] = not a[i + 1]
			ans.append(i + 1)
	return ans
n = int(next(reader))
s = next(reader)
ans = inversions(s, n)
if ans is None:
	print(-1)
else:
	print(len(ans))
	print(*ans)


n = int(input())
s = list(input())
b = 0
w = 0
for i in range(n):
	if s[i] == 'B':
		b += 1
	else:
		w += 1
if b % 2 and w % 2:
	print(-1)
elif b == 0 or w == 0:
	print(0)
else:
	if b % 2:
		x = 'W'
		y = 'B'
	else:
		x = 'B'
		y = 'W'
	ans = []
	for i in range(1, n):
		if s[i] == x and s[i - 1] == x:
			s[i] = y
			s[i - 1] = y
			ans.append(i)
		if s[i] == y and s[i - 1] == x:
			for j in range(i, 0, -1):
				if s[i] == y and s[i - 1] == x:
					ans.append(i)
					s[i] = x
					s[i - 1] = y
	if len(ans) <= 3 * n:
		print(len(ans))
		print(*ans)
	else:
		print(-1)


n = int(int(input()))
s = input()
a1 = b1 = 0
k1 = 0
l = list(s)
l1 = []
for i in s:
	if i == 'W':
		a1 += 1
	else:
		b1 += 1
if a1 % 2 == 0:
	k1 = 'W'
	k2 = 'B'
elif b1 % 2 == 0:
	k1 = 'B'
	k2 = 'W'
if k1 == 0:
	print(-1)
else:
	for i in range(n - 1):
		if l[i] == k1:
			l[i] = k2
			l1.append(i + 1)
			if l[i + 1] == k1:
				l[i + 1] = k2
			else:
				l[i + 1] = k1
	print(len(l1))
	if len(l):
		print(*l1)


x = int(input())
y = input()
c = 0
s = []
lis = y[0]
t = True
for i in range(x - 1):
	if y[i] == 'W':
		c += 1
	else:
		c -= 1
	if y[i] != lis and t == True:
		s = s + [str(i + 1)]
		t = False
	elif y[i] == lis and t == False:
		s = s + [str(i + 1)]
		t = False
	else:
		t = True
if y[x - 1] == 'W':
	c += 1
else:
	c -= 1
if y[x - 1] == lis and t == False or (y[x - 1] != lis and t == True):
	for j in range(x - 2):
		if j % 2 == 0:
			s = s + [str(j + 1)]
if c % 4 == x % 4 or c % 4 == 4 - x % 4:
	print(len(s))
	print(' '.join(s))
else:
	print(-1)


from collections import Counter, deque, defaultdict, OrderedDict, namedtuple
from bisect import bisect_left, bisect_right, insort
from math import sqrt, ceil, floor, factorial, gcd
from sys import stdin
a = int(input())
s = input()
c = Counter(s)
if c['B'] == 0 or c['W'] == 0:
	print(0)
elif c['B'] & 1 and c['W'] & 1:
	print(-1)
else:
	n = len(s)
	t = s[:]
	s = list(s)
	cnt = float('inf')
	cnt2 = float('inf')
	(l1, l2) = ([], [])
	if c['B'] & 1 == 0:
		ans = c['B'] // 2 + ceil(c['W'] / 2)
		cnt = 0
		for i in range(n - 1):
			if s[i] == 'B':
				s[i] = 'W'
				if s[i + 1] == 'B':
					s[i + 1] = 'W'
				else:
					s[i + 1] = 'B'
				cnt += 1
				l1.append(i + 1)
	s = list(t)
	if c['W'] & 1 == 0:
		ans2 = c['W'] // 2 + ceil(c['B'] / 2)
		cnt2 = 0
		for i in range(n - 1):
			if s[i] == 'W':
				s[i] = 'B'
				if s[i + 1] == 'B':
					s[i + 1] = 'W'
				else:
					s[i + 1] = 'B'
				cnt2 += 1
				l2.append(i + 1)
	if cnt < cnt2:
		print(cnt)
		print(*l1)
	else:
		print(cnt2)
		print(*l2)


n = int(input())
s = input()
w = s.count('W')
b = s.count('B')
r = []
if b % 2 != 0 and w % 2 != 0:
	exit(print(-1))
elif b % 2 != 0:
	s = [1 if x == 'B' else 0 for x in s]
elif w % 2 != 0:
	s = [1 if x == 'W' else 0 for x in s]
elif w < b:
	s = [1 if x == 'B' else 0 for x in s]
else:
	s = [1 if x == 'W' else 0 for x in s]
for i in range(n // 2):
	if s[i] == 0 and s[i + 1] == 0:
		r.append(i + 1)
		s[i] = s[i + 1] = 1
	elif s[i] == 0:
		r.append(i + 1)
		s[i] = 1
		s[i + 1] = 0
for i in range(n - 1, n // 2 - 1, -1):
	if s[i] == 0 and s[i - 1] == 0:
		r.append(i)
		s[i] = s[i - 1] = 1
	elif s[i] == 0:
		r.append(i)
		s[i - 1] = 0
print(len(r))
if r != []:
	print(*r)


a = int(input())
b = list(input())
n = 0
n1 = []
z = b[:]
while b.count('W') != a and b.count('B') != a:
	e = b
	for i in range(len(b) - 1):
		if b[i] == 'W':
			b[i] = 'B'
			if b[i + 1] == 'W':
				b[i + 1] = 'B'
			else:
				b[i + 1] = 'W'
			n += 1
			n1.append(i + 1)
	if e == b:
		while b.count('W') != a and b.count('B') != a:
			e = b[:]
			for i in range(len(b) - 1):
				if b[i] == 'B':
					b[i] = 'W'
					if b[i + 1] == 'B':
						b[i + 1] = 'W'
					else:
						b[i + 1] = 'B'
					n += 1
					n1.append(i + 1)
			if e == b:
				print(-1)
				break
		else:
			print(n)
			if n != 0:
				print(*n1)
			break
		break
else:
	print(n)
	if n != 0:
		print(*n1)


n = int(input())
s = str(input())
b = []
rz = []
for i in range(n):
	if s[i] == 'W':
		b += [0]
	else:
		b += [1]
for i in range(n - 2):
	if b[i] != b[i + 1]:
		b[i + 1] = (b[i + 1] + 1) % 2
		b[i + 2] = (b[i + 2] + 1) % 2
		rz += [i + 1]
if b[n - 1] != b[n - 2]:
	if n % 2 == 0:
		print(-1)
	else:
		print(len(rz) + n // 2)
		for i in range(len(rz)):
			print(rz[i] + 1, '', end='')
		for i in range(1, n, 2):
			print(i, '', end='')
elif rz == []:
	print(0)
else:
	print(len(rz))
	for i in range(len(rz)):
		print(rz[i] + 1, '', end='')


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
n = int(input())
s = list(input())
i = 0
ans = []
if len(set(s)) == 1:
	print(0)
	exit()
while i < n:
	j = i
	while s[j] == 'W':
		if j + 1 < n:
			if s[j + 1] == 'B':
				(s[j], s[j + 1]) = (s[j + 1], s[j])
				ans.append(j + 1)
			else:
				s[j] = 'B'
				s[j + 1] = 'B'
				ans.append(j + 1)
		j += 1
		if j == n:
			break
	i = j + 1
	if j == n:
		break
if len(set(s)) == 1:
	print(len(ans))
	print(*ans)
	exit()
elif s.count('B') % 2 == 0:
	i = 0
	while s[i] == 'B':
		ans.append(i + 1)
		i += 2
		if i >= n:
			break
	print(len(ans))
	print(*ans)
	exit()
else:
	print(-1)


def main():
	n = int(input())
	s = list(input())
	ans = []
	for i in range(1, n):
		if s[i - 1] == 'W':
			ans.append(i)
			s[i - 1] = 'B' if s[i - 1] == 'W' else 'W'
			s[i] = 'B' if s[i] == 'W' else 'W'
	if 'W' in s:
		for i in range(1, n):
			if s[i - 1] == 'B':
				ans.append(i)
				s[i - 1] = 'B' if s[i - 1] == 'W' else 'W'
				s[i] = 'B' if s[i] == 'W' else 'W'
		if 'B' in s:
			print('-1')
			return
	print(len(ans))
	print(' '.join((str(i) for i in ans)))
main()


import sys
import collections
from collections import Counter
import itertools
import math
import timeit

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
s = input()
d = {'B': 'W', 'W': 'B'}
rb = []
rw = []
white = [x for x in s]
black = [x for x in s]
for i in range(n - 1):
	if white[i] == 'B':
		rw.append(i + 1)
		white[i] = 'W'
		white[i + 1] = d[white[i + 1]]
	if black[i] == 'W':
		rb.append(i + 1)
		black[i] = 'B'
		black[i + 1] = d[black[i + 1]]
if ''.join(white) == 'W' * n:
	print(len(rw))
	prr(rw, ' ')
elif ''.join(black) == 'B' * n:
	print(len(rb))
	prr(rb, ' ')
else:
	print(-1)


n = int(input())
s = input()
z = [i for i in s]
if len(set(z)) == 1:
	print(0)
	exit()
ans = []
i = 0
while i < n - 1:
	if z[i] == 'B':
		i += 1
	elif z[i + 1] == 'W':
		z[i] = 'B'
		z[i + 1] = 'B'
		ans.append(i + 1)
		i += 2
	else:
		z[i] = 'B'
		z[i + 1] = 'W'
		ans.append(i + 1)
		i += 1
if len(set(z)) == 1:
	print(len(ans))
	print(*ans)
	exit()
z = [i for i in s]
ans = []
i = 0
while i < n - 1:
	if z[i] == 'W':
		i += 1
	elif z[i + 1] == 'B':
		z[i] = 'W'
		z[i + 1] = 'W'
		ans.append(i + 1)
		i += 2
	else:
		z[i] = 'W'
		z[i + 1] = 'B'
		ans.append(i + 1)
		i += 1
if len(set(z)) == 1:
	print(len(ans))
	print(*ans)
else:
	print(-1)


def main():
	n = int(input())
	string = str(input())
	list1 = list(string)
	list2 = list(string)
	arr = []
	for i in range(n - 1):
		if list1[i] == 'B':
			list1[i] = 'W'
			arr.append(i + 1)
			if list1[i + 1] == 'W':
				list1[i + 1] = 'B'
			else:
				list1[i + 1] = 'W'
	if list1[n - 1] == 'W':
		print(len(arr))
		for x in arr:
			print(x, end=' ')
		print()
		return
	else:
		arr = []
		for i in range(n - 1):
			if list2[i] == 'W':
				list2[i] = 'B'
				arr.append(i + 1)
				if list2[i + 1] == 'W':
					list2[i + 1] = 'B'
				else:
					list2[i + 1] = 'W'
		if list2[n - 1] == 'B':
			print(len(arr))
			for x in arr:
				print(x, end=' ')
			print()
			return
	print(-1)
	return
main()


z = int(input())
a = list(input())
l = []
for i in range(z - 1):
	if a[i] == 'B':
		if a[i + 1] == 'B':
			a[i] = a[i + 1] = 'W'
		else:
			a[i] = 'W'
			a[i + 1] = 'B'
		l.append(i + 1)
if len(set(a)) == 2:
	for i in range(z - 1):
		if a[i] == 'W':
			if a[i + 1] == 'W':
				a[i] = a[i + 1] = 'B'
			else:
				a[i] = 'B'
				a[i + 1] = 'W'
			l.append(i + 1)
	if len(set(a)) == 2:
		print(-1)
	else:
		print(len(l))
		print(*l)
else:
	print(len(l))
	print(*l)


def solvea():
	ties_nr = int(input())
	scarfs_nr = int(input())
	gilets_nr = int(input())
	jackets_nr = int(input())
	tie_jacket_price = int(input())
	sc_gl_jck_price = int(input())
	if tie_jacket_price > sc_gl_jck_price:
		ans = tie_jacket_price * min(ties_nr, jackets_nr)
		jackets_nr -= min(ties_nr, jackets_nr)
		ans += sc_gl_jck_price * min((scarfs_nr, gilets_nr, jackets_nr))
	else:
		ans = sc_gl_jck_price * min((scarfs_nr, gilets_nr, jackets_nr))
		jackets_nr -= min((scarfs_nr, gilets_nr, jackets_nr))
		ans += tie_jacket_price * min(ties_nr, jackets_nr)
	print(ans)

def solveb():
	n = int(input())
	s = list(input())
	if s.count('W') == 0:
		print(0)
		return
	if s.count('B') == 0:
		print(0)
		return
	operations = []
	if s.count('W') % 2 == 0:
		for i in range(n - 1):
			x = s[i]
			if x == 'B':
				continue
			operations.append(i + 1)
			s[i] = 'B'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
	elif s.count('B') % 2 == 0:
		for i in range(n - 1):
			x = s[i]
			if x == 'W':
				continue
			operations.append(i + 1)
			s[i] = 'W'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
	else:
		print(-1)
		return
	print(len(operations))
	print(*operations)
solveb()


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
n = int(z())
arr = list(fast())
ans = 0
lst = []
for i in range(n - 1):
	x = arr[i]
	y = arr[i + 1]
	if x == 'B':
		arr[i] = 'W'
		ans += 1
		lst.append(i + 1)
		if y == 'B':
			arr[i + 1] = 'W'
		else:
			arr[i + 1] = 'B'
if arr[-1] == 'B':
	for i in range(n - 1):
		x = arr[i]
		y = arr[i + 1]
		if x == 'W':
			arr[i] = 'B'
			ans += 1
			if ans > 3 * n:
				print(-1)
				exit()
			lst.append(i + 1)
			if y == 'W':
				arr[i + 1] = 'B'
			else:
				arr[i + 1] = 'W'
	if arr[-1] == 'W':
		for i in range(n - 1):
			x = arr[i]
			y = arr[i + 1]
			if x == 'B':
				arr[i] = 'W'
				ans += 1
				if ans > 3 * n:
					print(-1)
					exit()
				lst.append(i + 1)
				if y == 'B':
					arr[i + 1] = 'W'
				else:
					arr[i + 1] = 'B'
		if arr[-1] == 'W':
			print(ans)
			print(*lst)
			exit()
		else:
			print(-1)
			exit()
	else:
		print(ans)
		print(*lst)
		exit()
else:
	print(ans)
	print(*lst)


n = int(input())
cubs = input()
if cubs.count('W') % 2 + cubs.count('B') % 2 != n % 2:
	print(-1)
else:
	(count, s) = (0, [])
	cubs = list(cubs)
	for i in range(n - 1):
		if cubs[i] == 'W':
			cubs[i] = 'B'
			if cubs[i + 1] == 'W':
				cubs[i + 1] = 'B'
			else:
				cubs[i + 1] = 'W'
			count += 1
			s.append(str(i + 1))
	if cubs[-1] == 'W':
		count += n // 2
		for i in range(n // 2):
			s.append(str(i * 2 + 1))
	print(count)
	print(' '.join(s))


from collections import deque
n = int(input())
s = input()
d = deque()
if n & 1 == 0:
	w = 0
	b = 0
	for (j, i) in enumerate(s):
		if i == 'W':
			d.append(j)
			w += 1
		else:
			b += 1
	if w & 1 == 0 and b & 1 == 0:
		c = 0
		ans = []
		while len(d) != 0:
			c += 1
			t = d.popleft()
			if s[t + 1] == 'W':
				d.popleft()
			else:
				d.appendleft(t + 1)
			ans.append(t + 1)
		print(c)
		print(*ans)
	else:
		print(-1)
else:
	w = 0
	b = 0
	for (j, i) in enumerate(s):
		if i == 'W':
			w += 1
		else:
			b += 1
	c = ''
	if w == 0 or b == 0:
		print(0)
	else:
		if w & 1 == 0:
			c = 'W'
			for (j, i) in enumerate(s):
				if i == 'W':
					d.append(j)
		else:
			c = 'B'
			for (j, i) in enumerate(s):
				if i == 'B':
					d.append(j)
		ans = []
		while len(d) != 0:
			t = d.popleft()
			if s[t + 1] == c:
				d.popleft()
			else:
				d.appendleft(t + 1)
			ans.append(t + 1)
		print(len(ans))
		print(*ans)


n = int(input())
s1 = str(input())
x1 = s1.count('W')
x2 = s1.count('B')
if x1 == 0 or x2 == 0:
	print(0)
elif x1 % 2 != 0 and x2 % 2 != 0:
	print(-1)
else:
	k = 0
	l = []
	s = list(s1)
	if True:
		i = 0
		if x1 % 2 != 0:
			ch = 'W'
		else:
			ch = 'B'
		if True:
			while i < n - 1:
				if s[i] == s[i + 1] and s[i] != ch:
					k += 1
					l.append(i + 1)
					i += 2
				elif s[i] != s[i + 1] and s[i] != ch:
					k += 1
					l.append(i + 1)
					if s[i + 1] == 'B':
						s[i + 1] = 'W'
					else:
						s[i + 1] = 'B'
					i += 1
				elif s[i] == s[i + 1]:
					i += 2
				else:
					i += 1
		print(k)
		for i in range(len(l)):
			print(l[i], end=' ')
		print()


k = int(input())
s = input()
if s.count('W') == k or s.count('B') == k:
	print(0)
elif s.count('W') % 2 == 1 and s.count('B') % 2 == 1:
	print(-1)
else:
	ans1 = 9999999999999
	l1 = []
	if s.count('W') % 2 == 0:
		t = 0
		s1 = list(s)
		if s[0] == 'W':
			prev = 1
		else:
			prev = -1
		for i in range(1, k):
			if prev != -1 and s[i] == 'W':
				l1.append(i)
				t += 1
				prev = -1
			elif prev != -1:
				l1.append(i)
				t += 1
			elif s[i] == 'W':
				prev = 1
		ans1 = t
	ans2 = 9999999999999
	l2 = []
	if s.count('B') % 2 == 0:
		t = 0
		s1 = list(s)
		if s[0] == 'B':
			prev = 1
		else:
			prev = -1
		for i in range(1, k):
			if prev != -1 and s[i] == 'B':
				l2.append(i)
				t += 1
				prev = -1
			elif prev != -1:
				l2.append(i)
				t += 1
			elif s[i] == 'B':
				prev = 1
		ans2 = t
	if ans1 < ans2:
		print(ans1)
		print(*l1)
	else:
		print(ans2)
		print(*l2)


number = int(input())
words = input()
word = []
for i in range(0, number):
	if words[i] == 'B':
		word.append(0)
	elif words[i] == 'W':
		word.append(1)
arr = []
kim = word[0]
for i in range(1, number - 1):
	if word[i] != kim:
		word[i] = 1 - word[i]
		word[i + 1] = 1 - word[i + 1]
		arr.append(i + 1)
if word[number - 1] == kim:
	print(len(arr))
	for i in arr:
		print(i, end=' ')
elif number % 2 == 0:
	print('-1')
else:
	for i in range(0, number - 1):
		if i % 2 == 0:
			word[i] = 1 - word[i]
			word[i + 1] = 1 - word[i + 1]
			arr.append(i + 1)
	print(len(arr))
	for i in arr:
		print(i, end=' ')


n = int(input())
s = input()
Num_B = s.count('B')
Num_W = s.count('W')
Num_index = []
test = 0
if Num_B % 2 == 1 and Num_W % 2 == 1:
	print(-1)
	test = -1
elif Num_B % 2 == 0 and Num_W % 2 == 0:
	if Num_B >= Num_W:
		for x in range(len(s)):
			if s[x] == 'W':
				Num_index.append(x)
	else:
		for x in range(len(s)):
			if s[x] == 'B':
				Num_index.append(x)
elif Num_B % 2 == 1:
	for x in range(len(s)):
		if s[x] == 'W':
			Num_index.append(x)
elif Num_W % 2 == 1:
	for x in range(len(s)):
		if s[x] == 'B':
			Num_index.append(x)
if test != -1:
	k = 0
	move = []
	for x in range(0, len(Num_index), 2):
		k += Num_index[x + 1] - Num_index[x]
		move += [i + 1 for i in range(Num_index[x], Num_index[x + 1])]
	if k > 3 * n:
		print(-1)
	else:
		print(k)
		print(*move)


import sys
N = int(input())
s = [x == 'W' for x in input()]
ans = []
flip = False
for i in range(N - 1):
	if not s[i]:
		ans.append(i + 1)
		s[i] = not s[i]
		s[i + 1] = not s[i + 1]
if not s[-1]:
	if N % 2 == 0:
		print(-1)
		sys.exit(0)
	for i in range(0, N - 1, 2):
		ans.append(i + 1)
print(len(ans))
for x in ans:
	print(x, end=' ')


n = int(input())
num = list(input())
tnum = num.copy()
ans = 0
anss = []
for i in range(n - 1):
	if tnum[i] == 'W':
		tnum[i] = 'B'
		if tnum[i + 1] == 'B':
			tnum[i + 1] = 'W'
		else:
			tnum[i + 1] = 'B'
		ans += 1
		anss.append(i + 1)
if tnum[n - 1] == 'B':
	print(ans)
	if ans != 0:
		print(*anss)
	exit(0)
tnum = num.copy()
ans = 0
anss = []
for i in range(n - 1):
	if tnum[i] == 'B':
		tnum[i] = 'W'
		if tnum[i + 1] == 'B':
			tnum[i + 1] = 'W'
		else:
			tnum[i + 1] = 'B'
		ans += 1
		anss.append(i + 1)
if tnum[n - 1] == 'W':
	print(ans)
	if ans != 0:
		print(*anss)
	exit(0)
print(-1)


n = int(input())
s = list(input())
cnt = 0
lst = []
for i in range(1, n - 1):
	if s[i] != s[i - 1]:
		cnt = cnt + 1
		lst.append(i + 1)
		if s[i] == 'W':
			s[i] = 'B'
		else:
			s[i] = 'W'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
if s[-1] != s[-2]:
	if n % 2 == 0:
		print(-1)
	else:
		cnt = cnt + n // 2
		for i in range(1, n, 2):
			lst.append(i)
		print(cnt)
		print(*lst)
else:
	print(cnt)
	print(*lst)


def flip(x):
	if x == 'B':
		return 'W'
	return 'B'

def B():
	input()
	S = input()
	for ocz in 'BW':
		cop = [x for x in S]
		uz = 0
		roz = []
		for i in range(len(cop) - 1):
			if cop[i] != ocz:
				uz += 1
				roz.append(i + 1)
				cop[i] = ocz
				cop[i + 1] = flip(cop[i + 1])
		if cop[-1] == ocz:
			print(uz)
			for op in roz:
				print(op, end=' ')
			print()
			return
	print(-1)
B()


n = int(input())
c = list(input())
a = c.count('W')
b = n - a
if a % 2 == 0:
	f = 'B'
elif b % 2 == 0:
	f = 'W'
else:
	f = -1
if f == -1:
	print(-1)
else:
	m = []
	for i in range(n - 1):
		if c[i] != f:
			c[i] = 'W' if c[i] == 'B' else 'B'
			c[i + 1] = 'W' if c[i + 1] == 'B' else 'B'
			m.append(i + 1)
	print(len(m))
	for j in m:
		print(j, end=' ')
	print('')


(n, s, b, w) = (int(input()), list(input()), 0, 0)
for c in s:
	if c == 'B':
		b += 1
	else:
		w += 1
if w % 2 and b % 2:
	print(-1)
else:
	if w % 2 == 0 and b % 2 == 0:
		c = 'B' if b < w else 'W'
	else:
		c = 'B' if b % 2 else 'W'
	a = []
	for i in range(n - 1):
		if s[i] != c:
			a.append(i + 1)
			s[i] = c
			s[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
	print(len(a))
	print(*a)


def sol():
	n = int(input())
	s = list(input())
	b = s.count('B')
	w = s.count('W')
	if w % 2 == 1 and b % 2 == 1:
		print(-1)
		return
	ans = []
	s = list(s)
	if w % 2 == 1:
		odd = 'W'
		even = 'B'
	else:
		odd = 'B'
		even = 'W'
	for i in range(n - 1):
		if s[i] != odd:
			ans.append(i + 1)
			s[i] = odd
			s[i + 1] = even if s[i + 1] == odd else odd
	print(len(ans))
	print(' '.join(map(str, ans)))
sol()


n = int(input())
s = list(input())
prev = s[0]
i = 1
ans = []
while i < n and s[i] == prev:
	i += 1
j = i
while i < n - 1:
	if s[i] == prev:
		i += 1
		continue
	else:
		ans.append(i + 1)
		if s[i] != s[i + 1]:
			(s[i], s[i + 1]) = (s[i + 1], s[i])
			i += 1
		else:
			s[i] = s[i + 1] = prev
			i += 2
if s[-1] != s[-2] and n % 2 == 0:
	print(-1)
elif s[-1] != s[-2] and n % 2 == 1:
	for i in range(n - 2, 0, -2):
		ans.append(i)
	print(len(ans))
	print(*ans)
else:
	print(len(ans))
	print(*ans)


n = int(input())
a = [0 if c == 'W' else 1 for c in input()]
if a.count(0) == 0 or a.count(1) == 0:
	print(0)
	exit()
t = 0
if a.count(1) % 2 == 0:
	t = 1
ans = []
for i in range(n - 1):
	if a[i] == t:
		ans.append(i + 1)
		a[i] ^= 1
		a[i + 1] ^= 1
if a.count(t) > 0:
	print(-1)
else:
	print(len(ans))
	if ans:
		print(*ans)


n = int(input())
s = input()
(t1, t2) = (s.count('B'), s.count('W'))
a = list(s)
if t1 % 2 == 1 and t2 % 2 == 1:
	print(-1)
else:
	(count, result) = (0, list())
	b = '#'
	b = 'W' if t2 % 2 == 0 else 'B'
	for i in range(n - 1):
		if a[i] == b:
			count += 1
			a[i + 1] = 'B' if a[i + 1] == 'W' else 'W'
			result.append(i + 1)
	print(count)
	print(*result)


n = int(input())
s = input()
w = s.count('W')
b = n - w
s = list(s)
x = 0
if b == 0 or w == 0:
	print(0)
elif w % 2 == 1 and w % 2 == b % 2:
	print(-1)
else:
	t = s[0]
	an = []
	i = 0
	while i < n - 1:
		p = s[i] + s[i + 1]
		if p[0] == p[1] and p[0] != t:
			x += 1
			an.append(i + 1)
			i += 1
			(s[i - 1], s[i]) = (t, t)
		elif p[0] != t:
			x += 1
			an.append(i + 1)
			(s[i], s[i + 1]) = (s[i + 1], s[i])
		i += 1
	if s[n - 1] != t:
		i = 0
		while i < n - 1:
			x += 1
			an.append(i + 1)
			i += 2
	print(x)
	print(*an)


n = int(input())
a = list(input())
ans = []
if 'W' not in a or 'B' not in a:
	print(len(ans))
	print(*ans)
else:
	for i in range(n - 1):
		if a[i] == 'W':
			a[i] = 'B'
			ans.append(i + 1)
			if a[i + 1] == 'B':
				a[i + 1] = 'W'
			else:
				a[i + 1] = 'B'
	if 'W' not in a or 'B' not in a:
		print(len(ans))
		print(*ans)
	else:
		for i in range(n - 1, 0, -1):
			if a[i] == 'B':
				ans.append(i)
				a[i] = 'W'
				if a[i - 1] == 'W':
					a[i - 1] = 'B'
				else:
					a[i - 1] = 'W'
		if 'W' not in a or 'B' not in a:
			print(len(ans))
			print(*ans)
		else:
			for i in range(n - 1):
				if a[i] == 'W':
					a[i] = 'B'
					ans.append(i + 1)
					if a[i + 1] == 'B':
						a[i + 1] = 'W'
					else:
						a[i + 1] = 'B'
			if 'W' in a and 'B' in a:
				print(-1)
			else:
				print(len(ans))
				print(*ans)


import sys
input = sys.stdin.readline
n = int(input())
s = list(input())[:n]
res = []
flag = True
for i in range(1, n - 1):
	if flag:
		if s[i] == s[0]:
			flag = True
		else:
			res.append(i + 1)
			flag = False
	elif s[i] != s[0]:
		flag = True
	else:
		res.append(i + 1)
		flag = False
if flag and s[-1] == s[0]:
	print(len(res))
	print(*res)
	exit()
if not flag and s[-1] != s[0]:
	print(len(res))
	print(*res)
	exit()
res = [1]
flag = False
for i in range(1, n - 1):
	if flag:
		if s[i] != s[0]:
			flag = True
		else:
			res.append(i + 1)
			flag = False
	elif s[i] == s[0]:
		flag = True
	else:
		res.append(i + 1)
		flag = False
if flag and s[-1] != s[0]:
	print(len(res))
	print(*res)
	exit()
if not flag and s[-1] == s[0]:
	print(len(res))
	print(*res)
	exit()
print(-1)


n = input()
s = list(input())
if s.count('B') % 2 == 1 and s.count('W') % 2 == 1:
	print(-1)
else:
	ans = []
	for j in (0, 1):
		for i in range(len(s) - 1):
			if s[i] != 'WB'[j]:
				ans.append(i)
				s[i] = 'W' if s[i] == 'B' else 'B'
				s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
		if s.count('W') == 0 or s.count('B') == 0:
			break
	print(len(ans))
	print(' '.join((str(x + 1) for x in ans)))


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7
n = int(input())
a = list(input())
ans = []
for i in range(n - 1):
	if a[i] == 'B':
		continue
	else:
		a[i] = 'B'
		if a[i + 1] == 'B':
			a[i + 1] = 'W'
		else:
			a[i + 1] = 'B'
		ans.append(i + 1)
if a[-1] == 'W' and n % 2 == 0:
	print(-1)
elif a[-1] == 'W':
	print(len(ans) + n // 2)
	for i in ans:
		print(i, end=' ')
	for i in range(1, n, 2):
		print(i, end=' ')
else:
	print(len(ans))
	for i in ans:
		print(i, end=' ')


n = int(input())
s = input()
a = list()
test = 0
for i in s:
	if i == 'W':
		test += 1
		a.append(1)
	else:
		a.append(0)
answer = list()
if test == 0 or test == n:
	print(0)
elif (test % 2 != 0 or (n - test) % 2 != 0) and n % 2 == 0:
	print(-1)
else:
	for i in range(1, n - 1):
		if a[i] != a[i - 1]:
			a[i] = (a[i] + 1) % 2
			a[i + 1] = (a[i + 1] + 1) % 2
			answer.append(i + 1)
	for i in reversed(range(1, n - 1)):
		if a[i] != a[i + 1]:
			a[i] = (a[i] + 1) % 2
			a[i - 1] = (a[i - 1] + 1) % 2
			answer.append(i)
	print(len(answer))
	print(*answer)


n = int(input())
s = input()
s_ = []
for i in s:
	if i == 'W':
		s_.append(1)
	else:
		s_.append(0)
if len(set(s_)) == 1:
	print(0)
	exit()
A = []
for i in range(n - 1):
	if s_[i]:
		A.append(i + 1)
		s_[i] ^= 1
		s_[i + 1] ^= 1
if len(set(s_)) == 1:
	print(len(A))
	for i in A:
		print(i, end=' ')
elif len(s_) % 2 != 0:
	for i in range(0, len(s_) - 1, 2):
		A.append(i + 1)
	print(len(A))
	for i in A:
		print(i, end=' ')
else:
	print(-1)


from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	N = int(input())
	S = list(input())
	B = 0
	W = 0
	for i in range(N):
		if S[i] == 'B':
			B += 1
		else:
			W += 1
	if B % 2 == 1 and W % 2 == 1:
		print(-1)
		return
	if B % 2 == 0:
		cnt = 0
		ans = []
		for i in range(N - 1):
			if S[i] == 'B':
				cnt += 1
				ans.append(i + 1)
				S[i] = 'W'
				if S[i + 1] == 'B':
					S[i + 1] = 'W'
				else:
					S[i + 1] = 'B'
		print(cnt)
		if cnt != 0:
			print(' '.join(list(map(str, ans))))
	else:
		cnt = 0
		ans = []
		for i in range(N - 1):
			if S[i] == 'W':
				cnt += 1
				ans.append(i + 1)
				S[i] = 'B'
				if S[i + 1] == 'W':
					S[i + 1] = 'B'
				else:
					S[i + 1] = 'W'
		print(cnt)
		if cnt != 0:
			print(' '.join(list(map(str, ans))))
main()


n = int(input())
s = input()
moves = []
b = w = 0
for char in s:
	if char == 'B':
		b += 1
	else:
		w += 1
if b & 1:
	s = [False if s[i] == 'W' else True for i in range(n)]
else:
	s = [True if s[i] == 'W' else False for i in range(n)]
for i in range(n - 1):
	if s[i]:
		continue
	else:
		s[i] = not s[i]
		s[i + 1] = not s[i + 1]
		moves.append(i + 1)
else:
	if s[-1] == s[-2]:
		print(len(moves))
		print(*moves, sep=' ')
	else:
		print(-1)


from sys import stdin

def counter(c):
	if c == 'B':
		return 'W'
	return 'B'
n = int(stdin.readline().strip())
string = list(stdin.readline().strip())
temp = string[:]
ans = []
for i in range(n - 1):
	if string[i] == 'B':
		pass
	else:
		string[i] = 'B'
		string[i + 1] = counter(string[i + 1])
		ans.append(i + 1)
if string[-1] == 'B':
	print(len(ans))
	print(*ans)
	exit()
ans = []
string = temp[:]
for i in range(n - 1):
	if string[i] == 'W':
		pass
	else:
		string[i] = 'W'
		string[i + 1] = counter(string[i + 1])
		ans.append(i + 1)
if string[-1] == 'W':
	print(len(ans))
	print(*ans)
	exit()
print(-1)


from sys import stdin
input = stdin.readline

def mp():
	return map(int, input().split())

def it():
	return int(input())
n = it()
s = list(input())
s = s[:n]
k = s.copy()
v = []
for i in range(n - 1):
	if s[i] == 'B' and s[i + 1] == 'W':
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		v.append(i + 1)
	elif s[i] == 'W':
		pass
	elif s[i] == 'B' and s[i + 1] == 'B':
		s[i] = 'W'
		s[i + 1] = 'W'
		v.append(i + 1)
t = []
for i in range(n - 1):
	if k[i] == 'W' and k[i + 1] == 'B':
		(k[i], k[i + 1]) = (k[i + 1], k[i])
		t.append(i + 1)
	elif k[i] == 'B':
		pass
	elif k[i] == 'W' and k[i + 1] == 'W':
		k[i] = 'B'
		k[i + 1] = 'B'
		t.append(i + 1)
if len(set(s)) == 1:
	print(len(v))
	print(*v)
elif len(set(k)) == 1:
	print(len(t))
	print(*t)
else:
	print(-1)


a = int(input())
b = input()
l = len(b)
lw = b.count('W')
lb = b.count('B')
b = [i for i in b]
if lw % 2 == 0:
	ans = 0
	arr = []
	for i in range(l - 1):
		if b[i] == 'W':
			b[i] = 'B'
			if b[i + 1] == 'W':
				b[i + 1] = 'B'
			else:
				b[i + 1] = 'W'
			ans += 1
			arr.append(i + 1)
	print(ans)
	print(*arr)
elif lb % 2 == 0:
	ans = 0
	arr = []
	for i in range(l - 1):
		if b[i] == 'B':
			b[i] = 'W'
			if b[i + 1] == 'B':
				b[i + 1] = 'W'
			else:
				b[i + 1] = 'B'
			ans += 1
			arr.append(i + 1)
	print(ans)
	print(*arr)
else:
	print(-1)


length = int(input())
x = input()
tot = 0
in_binary = []
for i in range(length):
	if x[i] == 'B':
		tot += 1
to_change = []
x = [x[i] for i in range(length)]
if (length - tot) % 2 == 0:
	for i in range(length - 1):
		if x[i] == 'W':
			to_change.append(i + 1)
			if x[i + 1] == 'W':
				x[i + 1] = 'B'
			else:
				x[i + 1] = 'W'
	print(len(to_change))
	for i in to_change:
		print(i, end=' ')
elif tot % 2 == 0:
	for i in range(length - 1):
		if x[i] == 'B':
			to_change.append(i + 1)
			if x[i + 1] == 'B':
				x[i + 1] = 'W'
			else:
				x[i + 1] = 'B'
	print(len(to_change))
	for i in to_change:
		(print(i, end=' '),)
else:
	print('-1')


n = int(input())
s = list(reversed(input()))
s1 = s[::-1]
s2 = s[::-1]
ans = []
for i in range(n - 1):
	if s1[i] == 'W':
		ans.append(i + 1)
		if s1[i + 1] == 'W':
			s1[i + 1] = 'B'
		else:
			s1[i + 1] = 'W'
if s1[n - 1] == 'B':
	print(len(ans))
	print(*ans, sep=' ')
else:
	ans = []
	for i in range(n - 1):
		if s2[i] == 'B':
			ans.append(i + 1)
			if s2[i + 1] == 'B':
				s2[i + 1] = 'W'
			else:
				s2[i + 1] = 'B'
	if s2[n - 1] == 'W':
		print(len(ans))
		print(*ans, sep=' ')
	else:
		print(-1)


n = int(input())
s = list(input())
if n % 2 == 1:
	t = 'W' if s.count('W') % 2 == 1 else 'B'
	o = 'B' if t == 'W' else 'W'
	c = 0
	array = []
	for i in range(n - 1):
		if s[i] == o and s[i + 1] == o:
			s[i] = t
			s[i + 1] = t
			c += 1
			array.append(i + 1)
		elif s[i] == o and s[i + 1] == t:
			(s[i], s[i + 1]) = (s[i + 1], s[i])
			c += 1
			array.append(i + 1)
	print(c)
	print(*array)
if n % 2 == 0:
	if s.count('W') % 2 == 1:
		print(-1)
	else:
		r = s.copy()
		t = 'W'
		o = 'B'
		c1 = 0
		array = []
		for i in range(n - 1):
			if s[i] == o and s[i + 1] == o:
				s[i] = t
				s[i + 1] = t
				c1 += 1
				array.append(i + 1)
			elif s[i] == o and s[i + 1] == t:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				c1 += 1
				array.append(i + 1)
		array1 = array
		s = r
		array = []
		t = 'B'
		o = 'W'
		c2 = 0
		for i in range(n - 1):
			if s[i] == o and s[i + 1] == o:
				s[i] = t
				s[i + 1] = t
				c2 += 1
				array.append(i + 1)
			elif s[i] == o and s[i + 1] == t:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				c2 += 1
				array.append(i + 1)
		if c1 < c2:
			print(c1)
			print(*array1)
		else:
			print(c2)
			print(*array)


import sys
input = sys.stdin.readline
n = int(input())
s = input().strip()
s = list(s)
a = s.count('W')
b = s.count('B')
for i in range(n):
	if s[i] == 'W':
		s[i] = 0
	else:
		s[i] = 1
if a & 1 and b & 1:
	print(-1)
	exit()
if a % 2 == 0:
	ans = []
	for i in range(n - 1):
		if s[i] == 0:
			s[i] = 1 - s[i]
			s[i + 1] = 1 - s[i + 1]
			ans.append(i + 1)
	if s[0] != s[-1]:
		for i in range(0, n - 1, 2):
			ans.append(i + 1)
	print(len(ans))
	print(*ans)
elif b % 2 == 0:
	ans = []
	for i in range(n - 1):
		if s[i] == 1:
			s[i] = 1 - s[i]
			s[i + 1] = 1 - s[i + 1]
			ans.append(i + 1)
	if s[0] != s[-1]:
		for i in range(0, n - 1, 2):
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


n = int(input())
inp = list(input())
res = []
res1 = []
subans = []
ind = 0
changes = True
while changes:
	changes = False
	ind = 0
	while ind < n - 2:
		if inp[ind] == 'B' and inp[ind + 1] == 'W' and (inp[ind + 2] == 'B'):
			inp[ind] = 'W'
			inp[ind + 1] = 'W'
			inp[ind + 2] = 'W'
			subans.append(ind + 1)
			subans.append(ind + 2)
			changes = True
		if inp[ind] == 'W' and inp[ind + 1] == 'B' and (inp[ind + 2] == 'W'):
			inp[ind] = 'B'
			inp[ind + 1] = 'B'
			inp[ind + 2] = 'B'
			subans.append(ind + 1)
			subans.append(ind + 2)
			changes = True
		ind += 1
ind = 0
bf = inp[:]
while ind < n - 1:
	if bf[ind] == bf[ind + 1] == 'W':
		res1.append(ind + 1)
		bf[ind] = 'B'
		bf[ind + 1] = 'B'
		ind += 2
	else:
		if bf[ind] == 'W':
			bf[ind] = 'B'
			bf[ind + 1] = 'B' if bf[ind + 1] == 'W' else 'W'
			res1.append(ind + 1)
		ind += 1
if 'W' not in bf:
	res.append(res1)
ind = 0
res1 = []
bf = inp[:]
while ind < n - 1:
	if bf[ind] == bf[ind + 1] == 'B':
		res1.append(ind + 1)
		bf[ind] = 'W'
		bf[ind + 1] = 'W'
		ind += 2
	else:
		if bf[ind] == 'B':
			bf[ind] = 'W'
			bf[ind + 1] = 'W' if bf[ind + 1] == 'B' else 'B'
			res1.append(ind + 1)
		ind += 1
if 'B' not in bf:
	res.append(res1)
if 'W' not in inp or 'B' not in inp:
	print(len(subans))
	print(*subans)
elif len(res) == 0 and len(subans) == 0:
	print(-1)
elif len(res) == 0:
	if 'W' not in inp or 'B' not in inp:
		print(len(subans))
		print(*subans)
	else:
		print(-1)
elif len(subans) == 0:
	print(len(res[0]))
	print(*res[0])
else:
	print(len(subans) + len(res[0]))
	print(*subans + res[0])


n = int(input())
s = list(input())
sB = 0
sW = 0
for i in range(len(s)):
	if s[i] == 'W':
		sW += 1
	else:
		sB += 1
if sW % 2 == 1 and sB % 2 == 1:
	print(-1)
	exit()
if sW % 2 == 1 and sB % 2 == 0 or (sW % 2 == 0 and sB % 2 == 0 and (sB < sW)):
	for i in range(len(s)):
		if s[i] == 'W':
			s[i] = 'B'
		else:
			s[i] = 'W'
out = []
for i in range(len(s) - 1):
	if s[i] == 'W' and s[i + 1] == 'W':
		s[i] = 'B'
		s[i + 1] = 'B'
		out.append(str(i + 1))
	elif s[i] == 'W' and s[i + 1] == 'B':
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		out.append(str(i + 1))
print(len(out))
print(' '.join(out))


n = int(input())
string = input()
s = list(string)
ans1 = []
ans2 = []
i = 0
count = 0
while i < n - 1:
	if s[i] == 'B' and s[i + 1] == 'B':
		i += 2
	elif s[i] == 'B' and s[i + 1] == 'W':
		i += 1
	elif s[i] == 'W' and s[i + 1] == 'B':
		(s[i], s[i + 1]) = (s[i + 1], s[i])
		count += 1
		ans1.append(i + 1)
		i += 1
	else:
		(s[i], s[i + 1]) = ('B', 'B')
		count += 1
		ans1.append(i + 1)
		i += 2
if s.count('W') == 0:
	print(count)
	if count != 0:
		for i in ans1:
			print(i, end=' ')
		print()
else:
	i = 0
	count = 0
	s = list(string)
	while i < n - 1:
		if s[i] == 'W' and s[i + 1] == 'W':
			i += 2
		elif s[i] == 'W' and s[i + 1] == 'B':
			i += 1
		elif s[i] == 'B' and s[i + 1] == 'W':
			(s[i], s[i + 1]) = (s[i + 1], s[i])
			count += 1
			ans2.append(i + 1)
			i += 1
		else:
			(s[i], s[i + 1]) = ('W', 'W')
			count += 1
			ans2.append(i + 1)
			i += 2
	if s.count('B') == 0:
		print(count)
		if count != 0:
			for i in ans2:
				print(i, end=' ')
			print()
	else:
		print(-1)


n = int(input())
t = list(input())
r = []
f = False
m = [0 if i == 'W' else 1 for i in t]
for i in range(1, len(m) - 1):
	if m[i] != m[i - 1]:
		r.append(i + 1)
		m[i] ^= 1
		m[i + 1] ^= 1
	if sum(m) == n or sum(m) == 0:
		f = True
		break
if m[0] != m[-1]:
	if len(t) % 2 != 0:
		for i in range(0, len(m), 2):
			if i + 1 < len(m):
				r.append(i + 1)
				m[i] ^= 1
				m[i + 1] ^= 1
		f = True
if f or sum(m) == n or sum(m) == 0:
	print(len(r))
	if len(r):
		for i in r:
			print(i, end=' ')
		print()
else:
	print(-1)


n = int(input())
s = list(input().strip())
b = 0
w = 0
for i in range(n):
	if s[i] == 'B':
		b += 1
	else:
		w += 1
op = []
if b % 2 == 1 and w % 2 == 1:
	print(-1)
elif b == 0 or w == 0:
	print(0)
elif b % 2 == 0 and w % 2 == 0:
	if b < w:
		for i in range(n - 1):
			if s[i] < s[i + 1]:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				op.append(i + 1)
			elif s[i] == s[i + 1] == 'B':
				(s[i], s[i + 1]) = ('W', 'W')
				op.append(i + 1)
		print(len(op))
		print(' '.join(map(str, op)))
	else:
		for i in range(n - 1):
			if s[i] > s[i + 1]:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
				op.append(i + 1)
			elif s[i] == s[i + 1] == 'W':
				(s[i], s[i + 1]) = ('B', 'B')
				op.append(i + 1)
		print(len(op))
		print(' '.join(map(str, op)))
elif b % 2 == 0:
	for i in range(n - 1):
		if s[i] < s[i + 1]:
			(s[i], s[i + 1]) = (s[i + 1], s[i])
			op.append(i + 1)
		elif s[i] == s[i + 1] == 'B':
			(s[i], s[i + 1]) = ('W', 'W')
			op.append(i + 1)
	print(len(op))
	print(' '.join(map(str, op)))
else:
	for i in range(n - 1):
		if s[i] > s[i + 1]:
			(s[i], s[i + 1]) = (s[i + 1], s[i])
			op.append(i + 1)
		elif s[i] == s[i + 1] == 'W':
			(s[i], s[i + 1]) = ('B', 'B')
			op.append(i + 1)
	print(len(op))
	print(' '.join(map(str, op)))


def paint(blocks, num, colour, idx, changelist):
	if idx == num - 1:
		if blocks[idx] == colour:
			return True
		else:
			return False
	if blocks[idx] == colour:
		return paint(blocks, num, colour, idx + 1, changelist)
	else:
		blocks[idx] = colour
		if blocks[idx + 1] == 'B':
			blocks[idx + 1] = 'W'
		else:
			blocks[idx + 1] = 'B'
		changelist.append(idx)
		return paint(blocks, num, colour, idx + 1, changelist)
num = int(input())
blocks = list(str(input()))
dblocks = blocks.copy()
changelist = list()
col = 'W'
val = paint(blocks, num, col, 0, changelist)
if val == True:
	print(len(changelist))
	for i in changelist:
		print(i + 1, end=' ')
	exit(0)
changelist = list()
col = 'B'
val = paint(dblocks, num, col, 0, changelist)
if val == True:
	print(len(changelist))
	for i in changelist:
		print(i + 1, end=' ')
	exit(0)
else:
	print('-1')


n = int(input())
s1 = list(input())
s2 = s1
ans1 = ans2 = []
for i in range(n - 1):
	if s1[i] == 'B':
		s1[i] = 'W'
		if s1[i + 1] == 'B':
			s1[i + 1] = 'W'
		else:
			s1[i + 1] = 'B'
		ans1.append(i + 1)
if s1[n - 1] == 'W':
	print(len(ans1))
	if len(ans1) > 0:
		print(*ans1)
else:
	for i in range(n - 1):
		if s2[i] == 'W':
			s2[i] = 'B'
			if s2[i + 1] == 'W':
				s2[i + 1] = 'B'
			else:
				s2[i + 1] = 'W'
			ans2.append(i + 1)
	if s2[n - 1] != 'W':
		print(len(ans2))
		if len(ans2) > 0:
			print(*ans2)
	else:
		print('-1')


n = int(input())
s = input()
l = list(s)
s = list(s)
for i in range(n):
	if s[i] == 'W':
		s[i] = 1
		l[i] = 1
	else:
		s[i] = 0
		l[i] = 0
f = 1
p = []
c = 0
for i in range(n - 1):
	if s[i] == 1:
		continue
	else:
		p.append(i + 1)
		s[i] = 1 - s[i]
		s[i + 1] = 1 - s[i + 1]
		c += 1
if len(set(s)) == 1:
	print(c)
	if c > 0:
		print(*p)
else:
	p = []
	c = 0
	for i in range(n - 1):
		if l[i] == 0:
			continue
		else:
			p.append(i + 1)
			l[i] = 1 - l[i]
			l[i + 1] = 1 - l[i + 1]
			c += 1
	if len(set(l)) == 1:
		print(c)
		if c > 0:
			print(*p)
	else:
		print(-1)


n = int(input())
sq = input().strip()
sq = list(sq)
(b, w) = (0, 0)
for ch in sq:
	if ch == 'B':
		b += 1
	else:
		w += 1
if b == 0 or w == 0:
	print(0)
	exit(0)
elif b & 1 == 1 and w & 1 == 1:
	print(-1)
	exit(0)
c_to = None
other = None
if b & 1:
	c_to = 'B'
	other = 'W'
else:
	c_to = 'W'
	other = 'B'
ans = []
while True:
	for i in range(1, n):
		if sq[i - 1] != sq[i] and sq[i - 1] == other:
			sq[i - 1] = sq[i]
			sq[i] = other
			ans.append(i - 1)
		if sq[i - 1] == sq[i] and sq[i - 1] != c_to:
			sq[i - 1] = sq[i] = c_to
			ans.append(i - 1)
	cc = sq.count(other)
	if cc == 0 or cc == n:
		print(len(ans))
		ans = list(map(lambda x: x + 1, ans))
		print(*ans)
		exit(0)


n = int(input())
s = list(input())

def inv(si):
	if si == 'W':
		return 'B'
	else:
		return 'W'
fs = []
i = 0
while i < n - 2:
	b = s[i]
	s1 = s[i + 1]
	s2 = s[i + 2]
	if b == s1 and s1 == s2:
		i += 2
	elif b == s1:
		i += 1
	elif b != s1:
		s[i + 1] = inv(s[i + 1])
		s[i + 2] = inv(s[i + 2])
		fs.append(i + 1 + 1)
		i += 1
if s[n - 3] == s[n - 2] and s[n - 2] == s[n - 1]:
	print(len(fs))
	if len(fs) > 0:
		print(*fs)
elif len(s) % 2 == 0:
	print(-1)
else:
	for i in range(0, n - 1, 2):
		fs.append(i + 1)
	print(len(fs))
	if len(fs) > 0:
		print(*fs)


n = int(input())
arr = list(input().strip())

def foo(arr, c1, c2):
	global n
	c = 0
	st = []
	for i in range(n - 1):
		if arr[i] == c1:
			continue
		else:
			arr[i] = c1
			arr[i + 1] = c1 if arr[i + 1] == c2 else c2
			c += 1
			st.append(i + 1)
	if arr[-1] == c2:
		return (-1, -1)
	else:
		return (c, ' '.join(map(str, st)))
(a, b) = foo(list(arr), 'B', 'W')
(c, d) = foo(list(arr), 'W', 'B')
if a != -1:
	print(a)
	print(b)
elif c != -1:
	print(c)
	print(d)
else:
	print(-1)


amount = int(input())
line = list(input())
if line.count('W') % 2 == 1 and line.count('B') % 2 == 1:
	print(-1)
elif line.count('B') % 2 == 0:
	ans = []
	for i in range(amount - 1):
		if line[i] == 'B' and line[i + 1] == 'B':
			ans.append(i + 1)
			line[i] = 'W'
			line[i + 1] = 'W'
		elif line[i] == 'B' and line[i + 1] == 'W':
			ans.append(i + 1)
			line[i] = 'W'
			line[i + 1] = 'B'
	print(len(ans))
	print(*ans)
else:
	ans = []
	for i in range(amount - 1):
		if line[i] == 'W' and line[i + 1] == 'W':
			ans.append(i + 1)
			line[i] = 'B'
			line[i + 1] = 'B'
		elif line[i] == 'W' and line[i + 1] == 'B':
			ans.append(i + 1)
			(line[i], line[i + 1]) = (line[i + 1], line[i])
	print(len(ans))
	print(*ans)


n = int(input())
s = input()
d = {'B': [], 'W': []}
for (i, e) in enumerate(s):
	d[e].append(i)
(lb, lw) = (len(d['B']), len(d['W']))
(b, c) = (lb % 2 != 0, lw % 2 != 0)
if b and c:
	print(-1)
elif lb and (not lw) or (lw and (not lb)):
	print(0)
else:
	if not b:
		B = d['B']
		pos = []
		i = 0
		while i < lb:
			for y in range(B[i], B[i + 1]):
				pos.append(y + 1)
			i += 2
	else:
		W = d['W']
		pos = []
		i = 0
		while i < lw:
			for y in range(W[i], W[i + 1]):
				pos.append(y + 1)
			i += 2
	print(len(pos))
	print(*pos)


def countWhite(s):
	i = 0
	for elem in s:
		if elem == 'W':
			i += 1
	return i

def countBlack(s):
	i = 0
	for elem in s:
		if elem == 'B':
			i += 1
	return i

def stringToList(s):
	list = []
	for elem in s:
		list.append(elem)
	return list

def listToString(l):
	string = ''
	for elem in l:
		string += '%s ' % elem
	return string

def swap(char):
	if char == 'W':
		char = 'B'
	elif char == 'B':
		char = 'W'
	return char

def turnBlack(l):
	global k
	list = []
	for i in range(0, len(l)):
		if l[i] == 'W':
			k += 1
			list.append(i + 1)
			l[i] = 'B'
			l[i + 1] = swap(l[i + 1])
	return list

def turnWhite(l):
	global k
	list = []
	for i in range(0, len(l)):
		if l[i] == 'B':
			k += 1
			list.append(i + 1)
			l[i] = 'W'
			l[i + 1] = swap(l[i + 1])
	return list
n = int(input())
BlackWhite = input()
useThis = stringToList(BlackWhite)
nB = countBlack(BlackWhite)
nW = countWhite(BlackWhite)
k = 0
if nB == 0 or nW == 0:
	print(k)
elif nB % 2 != 0 and nW % 2 != 0:
	print(-1)
elif nB % 2 == 0 and nW % 2 == 0:
	x = turnBlack(useThis)
	print(k)
	print(listToString(x))
elif nB % 2 == 0 and nW % 2 != 0:
	y = turnWhite(useThis)
	print(k)
	print(listToString(y))
elif nB % 2 != 0 and nW % 2 == 0:
	z = turnBlack(useThis)
	print(k)
	print(listToString(z))


n = int(input())
s = input()
a = list(s)
if a.count('B') % 2 * (a.count('W') % 2):
	print(-1)
	exit()
b = []
if a.count('B') % 2:
	m = 'W'
else:
	m = 'B'
for i in range(n - 1):
	if a[i] == m:
		b.append(i + 1)
		if a[i] == 'W':
			a[i] = 'B'
		else:
			a[i] = 'W'
		if a[i + 1] == 'W':
			a[i + 1] = 'B'
		else:
			a[i + 1] = 'W'
print(len(b))
if len(b):
	print(*b)


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
input_a = lambda fun: map(fun, stdin.readline().split())

def read():
	n = int(input())
	s = input()
	return (n, s)

def solve(n, s: str):
	s = [True if x == 'B' else False for x in s]
	(b, w) = (s.count(True), s.count(False))
	if b % 2 != 0 and w % 2 != 0:
		return None
	letter = True if b % 2 == 0 else False
	flips = []
	for i in range(n - 1):
		if s[i] == letter:
			if s[i] != s[i + 1]:
				(s[i], s[i + 1]) = (s[i + 1], s[i])
			else:
				s[i] = s[i + 1] = not letter
			flips.append(i + 1)
	return flips
result = solve(*read())
if result is None:
	print(-1)
else:
	print(len(result))
	print(*result)


n = int(input())
s = list(input())
t = s.copy()
ans1 = []
ans2 = []
for i in range(n - 1):
	if s[i] == 'W':
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		ans1.append(i + 1)
	if t[i] == 'B':
		if t[i + 1] == 'B':
			t[i + 1] = 'W'
		else:
			t[i + 1] = 'B'
		ans2.append(i + 1)
if s[-1] == 'B':
	print(len(ans1))
	print(' '.join(map(str, ans1)))
elif t[-1] == 'W':
	print(len(ans2))
	print(' '.join(map(str, ans2)))
else:
	print(-1)


n = int(input())
l = list(input())
f = 0
for i in range(n):
	if l[i] == 'B':
		l[i] = 0
	else:
		l[i] = 1
l1 = l[:]
if f == 0:
	ans = []
	for i in range(n - 1):
		if l[i] == 1:
			l[i] = abs(1 - l[i])
			l[i + 1] = abs(1 - l[i + 1])
			ans.append(i + 1)
	if len(set(l)) == 1:
		f = 1
l = l1[:]
if f == 0:
	ans = []
	for i in range(n - 1):
		if l[i] == 0:
			l[i] = abs(1 - l[i])
			l[i + 1] = abs(1 - l[i + 1])
			ans.append(i + 1)
	if len(set(l)) == 1:
		f = 1
if f == 1:
	print(len(ans))
	print(*ans)
else:
	print(-1)


import math

def main():
	n = int(input())
	s = str(input())
	b = 0
	w = 0
	p = []
	for i in range(n):
		if s[i] == 'B':
			p.append(1)
			b += 1
		else:
			p.append(0)
			w += 1
	steps = -1
	op = []
	if b % 2 == 0:
		steps = 0
		for i in range(n - 1):
			if p[i] == 1:
				steps += 1
				op.append(i + 1)
				p[i] = 1 - p[i]
				p[i + 1] = 1 - p[i + 1]
	elif w % 2 == 0:
		steps = 0
		for i in range(n - 1):
			if p[i] == 0:
				steps += 1
				op.append(i + 1)
				p[i] = 1 - p[i]
				p[i + 1] = 1 - p[i + 1]
	print(steps)
	if steps >= 0:
		print(' '.join([str(x) for x in op]))
main()


def func(ss, l, c):
	if c == 'W':
		c1 = 'B'
	else:
		c1 = 'W'
	for i in range(n - 1):
		if ss[i] == c:
			ss[i] = c1
			ss[i + 1] = c if ss[i + 1] == c1 else c1
			l.append(i + 1)
	if len(set(ss)) == 1:
		return l
	else:
		return []
(n, s) = (int(input()), list(input()))
(ans, ans1) = (func(list(s), [], 'B'), func(list(s), [], 'W'))
if len(set(s)) == 1:
	print(0)
elif not ans and (not ans1):
	print(-1)
else:
	print(len(ans1) if ans1 != [] else len(ans), '\n', *(ans1 if ans1 != [] else ans))


n = int(input())
s = list(input())

def solve(n, w):
	b = w.copy()
	(sw, sb) = ([], [])
	for i in range(n - 1):
		if w[i] == 'B':
			sw.append(i + 1)
			w[i + 1] = 'W' if w[i + 1] == 'B' else 'B'
		if b[i] == 'W':
			sb.append(i + 1)
			b[i + 1] = 'W' if b[i + 1] == 'B' else 'B'
	if len(sw) < 3 * n and w[-1] == 'W':
		return sw
	if len(sb) < 3 * n and b[-1] == 'B':
		return sb
	return None
ans = solve(n, s)
if ans is None:
	print(-1)
else:
	print(len(ans))
	print(' '.join([str(i) for i in ans]))


import time

def st(it):
	return [str(ita) for ita in it]
LOCAL = False
start_time = None
if LOCAL:
	start_time = time.time()
n = int(input())
a = list(map(lambda x: 1 if x == 'B' else 0, input()))
sum_a = sum(a)
blacks = sum_a
whites = n - blacks
if blacks % 2 == 1 and whites % 2 == 1:
	print(-1)
else:
	to_change = 1 if blacks % 2 == 0 else 0
	chg = []
	for i in range(n - 1):
		if a[i] == to_change:
			a[i + 1] = (a[i + 1] + 1) % 2
			a[i] = (a[i] + 1) % 2
			chg.append(i + 1)
	print(len(chg))
	print(' '.join(st(chg)))
if LOCAL:
	print('--- %s seconds ---' % (time.time() - start_time))


import math
elem = int(input())
st = list(input())
st2 = st.copy()
ch = 0
ar = []
for x in range(len(st)):
	if st[x] == 'B':
		continue
	if x == len(st) - 1:
		ch = 1
		break
	st[x] = 'W'
	if st[x + 1] == 'W':
		st[x + 1] = 'B'
	else:
		st[x + 1] = 'W'
	ar.append(x + 1)
if ch == 0:
	print(len(ar))
	if len(ar) != 0:
		print(*ar)
else:
	ch = 0
	ar = []
	for x in range(len(st)):
		if st2[x] == 'W':
			continue
		if x == len(st2) - 1:
			ch = 1
			break
		st2[x] = 'B'
		if st2[x + 1] == 'W':
			st2[x + 1] = 'B'
		else:
			st2[x + 1] = 'W'
		ar.append(x + 1)
	if ch == 0:
		print(len(ar))
		if len(ar) != 0:
			print(*ar)
	else:
		print(-1)


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
S = list(input())
X = Y = ''
C = Counter(S)
if C['B'] % 2 == 0:
	X = 'B'
	Y = 'W'
elif C['W'] % 2 == 0:
	X = 'W'
	Y = 'B'
else:
	print(-1)
	exit()
ans = []
for i in range(N - 1):
	if S[i] == S[i + 1] == X:
		S[i] = S[i + 1] = Y
		ans.append(i + 1)
	elif S[i] == X and S[i + 1] == Y:
		(S[i], S[i + 1]) = (S[i + 1], S[i])
		ans.append(i + 1)
print(len(ans))
if ans:
	print(*ans)


n = int(input())
A = [1 if x == 'W' else 0 for x in list(input())]
R = []
if n == 2:
	if A[1] == A[0]:
		print(0)
	else:
		print(-1)
else:
	B = [not x for x in A]
	if A[0] == 0:
		A[0] = 1
		A[1] = not A[1]
		R.append(1)
	for i in range(1, n):
		if i < n - 1 and A[i] == 0:
			A[i] = 1
			A[i + 1] = not A[i + 1]
			R.append(i)
			R.append(i + 1)
			R.append(i)
	if A[-1] == 1 or (A[-1] == 0 and (len(A) - 1) % 2 == 0):
		print(round(len(R) + ((len(A) - 1) / 2 if A[-1] == 0 and (len(A) - 1) % 2 == 0 else 0)))
		for i in R:
			print(i, end=' ')
		if A[-1] == 0 and (len(A) - 1) % 2 == 0:
			for i in range(0, len(A) - 1, 2):
				print(i + 1, end=' ')
		print()
	else:
		print(-1)


input()
ans = []
s = input()
a = []
for x in s:
	if x == 'B':
		a.append(0)
	else:
		a.append(1)
import copy
tmp = copy.deepcopy(a)
for i in range(1, len(s)):
	if a[i - 1] == 0:
		ans.append(i)
		a[i - 1] = 1
		a[i] ^= 1
if a[i] == 1:
	print(len(ans))
	print(' '.join([str(x) for x in ans]))
else:
	a = tmp
	ans = []
	for i in range(1, len(s)):
		if a[i - 1] == 1:
			ans.append(i)
			a[i - 1] = 0
			a[i] ^= 1
	if a[i] == 0:
		print(len(ans))
		print(' '.join([str(x) for x in ans]))
	else:
		print(-1)


a = int(input())
b = input()
if b.count('B') % 2 == 1 and b.count('W') % 2 == 1:
	print(-1)
else:
	b = list(b)
	if b.count('B') % 2 == 1:
		for i in range(len(b)):
			if b[i] == 'B':
				b[i] = 'W'
			else:
				b[i] = 'B'
	b = list(b)
	ans = []
	for i in range(len(b) - 1):
		if b[i] == 'B' and b[i + 1] == 'B':
			ans.append(str(i + 1))
			b[i] = 'W'
			b[i + 1] = 'W'
	for i in range(len(b) - 1):
		if b[i] == 'B' and b[i + 1] == 'B':
			ans.append(str(i + 1))
			b[i] = 'W'
			b[i + 1] = 'W'
		elif b[i] == 'B' and b[i + 1] == 'W':
			ans.append(str(i + 1))
			b[i] = 'W'
			b[i + 1] = 'B'
	print(len(ans))
	print(' '.join(ans))


def find():
	if l[n - 1] == 'B':
		for i in range(0, n - 2, 2):
			m.append(i + 1)
	elif l[0] == 'B':
		for i in range(n - 2, 0, -2):
			m.append(i + 1)
	print(len(m))
	for j in range(len(m)):
		print(m[j], end=' ')
n = int(input())
s = str(input())
l = list(s)
if 'B' not in s:
	print('0')
else:
	m = []
	for i in range(0, len(s) - 1):
		if l[i] != 'W':
			l[i] = 'W'
			m.append(i + 1)
			if l[i + 1] == 'W':
				l[i + 1] = 'B'
			else:
				l[i + 1] = 'W'
	if 'B' in l:
		if l.count('B') == 1 and l.count('W') % 2 == 0 and (l[0] == 'B' or l[len(l) - 1] == 'B'):
			find()
		else:
			print('-1')
	else:
		print(len(m))
		for j in range(len(m)):
			print(m[j], end=' ')


def getInv(x):
	if x == 'W':
		return 'B'
	return 'W'
n = int(input())
sir = list(input())
inv = []
for x in sir:
	inv.append(getInv(x))
ans = []
for i in range(0, len(sir) - 1):
	if sir[i] == 'W':
		ans.append(i + 1)
		sir[i] = getInv(sir[i])
		sir[i + 1] = getInv(sir[i + 1])
if sir[len(sir) - 1] == 'B':
	print(len(ans))
	for x in ans:
		print(x, end=' ')
else:
	ans = []
	for i in range(0, len(inv) - 1):
		if inv[i] == 'W':
			ans.append(i + 1)
			inv[i] = getInv(inv[i])
			inv[i + 1] = getInv(inv[i + 1])
	if inv[len(inv) - 1] == 'B':
		print(len(ans))
		for x in ans:
			print(x, end=' ')
	else:
		print(-1)


n = int(input())
s = input()
operation = [0] * (3 * n)
count = 0
arr = [0] * n
for i in range(n):
	if s[i] == 'W':
		arr[i] = 1
	else:
		arr[i] = 0
if n & 1 == 1:
	x = arr[0]
	for i in range(1, n - 1):
		if arr[i] == x:
			continue
		operation[count] = i + 1
		count += 1
		arr[i] = arr[i] ^ 1
		arr[i + 1] = arr[i + 1] ^ 1
	if arr[n - 1] == arr[0]:
		print(count)
		print(*operation[:count])
	else:
		temp = n - 3
		while temp >= 0:
			operation[count] = temp + 1
			count += 1
			temp -= 2
		print(count)
		print(*operation[:count])
else:
	x = arr[0]
	for i in range(1, n - 1):
		if arr[i] == x:
			continue
		operation[count] = i + 1
		count += 1
		arr[i] = arr[i] ^ 1
		arr[i + 1] = arr[i + 1] ^ 1
	if arr[n - 1] == arr[0]:
		print(count)
		print(*operation[:count])
	else:
		print(-1)


n = int(input())
s = list(input())
nw = 0
nb = 0
for i in s:
	if i == 'W':
		nw += 1
	else:
		nb += 1
num = 0
ans = []
if nw % 2 != 0 and nb % 2 != 0:
	print(-1)
else:
	if nw % 2 == 0 and nb % 2 == 0:
		if nw > nb:
			en = 'W'
		else:
			en = 'B'
	elif nw % 2 == 0:
		en = 'B'
	else:
		en = 'W'
	for i in range(n - 1):
		if s[i] != en:
			num += 1
			ans.append(i + 1)
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
			if s[i] == 'W':
				s[i] = 'B'
			else:
				s[i] = 'W'
	print(num)
	if num != 0:
		print(' '.join((str(k) for k in ans)))


n = int(input())
s = list(input())
b = 0
w = 0
T = []
for i in s:
	if i == 'B':
		b += 1
	else:
		w += 1
if b % 2 == 1 and w % 2 == 1:
	print(-1)
elif b == 0 or w == 0:
	print(0)
else:
	for i in range(len(s) - 1):
		if s[i] == 'B' and s[i + 1] == 'W':
			s[i] = 'W'
			s[i + 1] = 'B'
			T.append(i + 1)
		elif s[i] == 'B' and s[i + 1] == 'B':
			s[i] = 'W'
			s[i + 1] = 'W'
			T.append(i + 1)
	if b % 2 == 0:
		i = len(s) - 1
		while s[i] != 'W':
			s[i] = 'W'
			s[i - 1] = 'W'
			T.append(i)
			i -= 2
	else:
		i = 0
		while s[i] != 'B':
			s[i] = 'B'
			s[i + 1] = 'B'
			T.append(i + 1)
			i += 2
	print(len(T))
	print(*T)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
n = int(ri())
s = ri()
(cb, cw) = (0, 0)
for i in s:
	if i == 'B':
		cb += 1
	else:
		cw += 1
if cb % 2 == 1 and cw % 2 == 1:
	print(-1)
else:
	ans = []
	if cb % 2 == 1:
		prev = -1
		for i in range(n):
			if s[i] == 'W':
				if prev == -1:
					prev = i
				else:
					for j in range(i - 1, prev - 1, -1):
						ans.append(j + 1)
					prev = -1
	else:
		prev = -1
		for i in range(n):
			if s[i] == 'B':
				if prev == -1:
					prev = i
				else:
					for j in range(i - 1, prev - 1, -1):
						ans.append(j + 1)
					prev = -1
	print(len(ans))
	print(*ans)


for g in range(0, 1):
	n = int(input())
	s = input()
	b = 0
	w = 0
	indexb = []
	indexw = []
	for i in range(0, len(s)):
		if s[i] == 'B':
			b = b + 1
			indexb.append(i + 1)
		else:
			w = w + 1
			indexw.append(i + 1)
	ops = 0
	position = []
	if b == 0:
		print(0)
	elif w == 0:
		print(0)
	elif w % 2 != 0 and b % 2 != 0:
		print(-1)
	elif w % 2 == 0 and b % 2 != 0:
		for i in range(0, len(indexw), 2):
			ops += indexw[i + 1] - indexw[i]
			k = 0
			for j in range(0, indexw[i + 1] - indexw[i]):
				position.append(indexw[i] + k)
				k = k + 1
		print(ops)
		for i in range(0, len(position)):
			print(position[i], end=' ')
		print('')
	elif b % 2 == 0 and w % 2 != 0:
		for i in range(0, len(indexb), 2):
			ops += indexb[i + 1] - indexb[i]
			k = 0
			for j in range(0, indexb[i + 1] - indexb[i]):
				position.append(indexb[i] + k)
				k = k + 1
		print(ops)
		for i in range(0, len(position)):
			print(position[i], end=' ')
		print('')
	elif b % 2 == 0 and w % 2 == 0:
		if b > w:
			for i in range(0, len(indexw), 2):
				ops += indexw[i + 1] - indexw[i]
				k = 0
				for j in range(0, indexw[i + 1] - indexw[i]):
					position.append(indexw[i] + k)
					k = k + 1
			print(ops)
			for i in range(0, len(position)):
				print(position[i], end=' ')
			print('')
		else:
			for i in range(0, len(indexb), 2):
				ops += indexb[i + 1] - indexb[i]
				k = 0
				for j in range(0, indexb[i + 1] - indexb[i]):
					position.append(indexb[i] + k)
					k = k + 1
			print(ops)
			for i in range(0, len(position)):
				print(position[i], end=' ')
			print('')


def can(S, c):
	ans = ''
	nc = False
	for i in range(len(S)):
		if S[i] != c and nc == False or (S[i] == c and nc == True):
			ans += str(i + 1) + ' '
			nc = True
		else:
			nc = False
	if nc == True:
		return False
	return ans
n = int(input())
s = input()
ans = can(s, 'B')
if ans != False:
	print(str(ans.count(' ')) + '\n' + ans)
	exit()
ans = can(s, 'W')
if ans != False:
	print(str(ans.count(' ')) + '\n' + ans)
	exit()
print('-1')


t = int(input())
s = input()
white = []
white_count = 0
temp = list(s)
for j in range(len(s) - 1):
	if temp[j] == 'B':
		white_count += 1
		temp[j + 1] = 'W' if temp[j + 1] == 'B' else 'B'
		white.append(j + 1)
if temp[-1] == 'W':
	print(white_count)
	if len(white) != 0:
		print(*white)
else:
	black = []
	black_count = 0
	temp = list(s)
	for j in range(len(s) - 1):
		if temp[j] == 'W':
			black_count += 1
			temp[j + 1] = 'B' if temp[j + 1] == 'W' else 'W'
			black.append(j + 1)
	if temp[-1] == 'B':
		print(black_count)
		if len(black) != 0:
			print(*black)
	else:
		print(-1)


n = int(input().strip())
blocks = list(input().strip())
c = blocks[0]
cnt = 0
for b in blocks:
	if b == c:
		cnt += 1
if cnt % 2 and (n - cnt) % 2:
	print(-1)
else:
	moves = []
	if (n - cnt) % 2:
		c = 'W' if c == 'B' else 'B'
	for i in range(n - 1):
		if blocks[i] != c:
			blocks[i] = c
			blocks[i + 1] = 'W' if blocks[i + 1] == 'B' else 'B'
			moves.append(str(i + 1))
	print(len(moves))
	print(' '.join(moves))


def num():
	return int(input())

def line():
	return map(int, input().split())
n = num()
s = [c == 'B' for c in input()]
ans = []
for k in range(3):
	q = s[0]
	for i in range(1, n - 1):
		if s[i] != q:
			ans.append(i + 1 if k % 2 == 0 else n - i - 1)
			s[i] = 1 - s[i]
			s[i + 1] = 1 - s[i + 1]
	if s[-1] == q:
		break
	s = s[::-1]
if s[0] == s[-1]:
	print(len(ans))
	print(' '.join(map(str, ans)))
else:
	print(-1)


import sys

def I():
	return sys.stdin.readline().rstrip()

def main():
	n = int(I())
	s = I()
	ind = []
	l = [i == 'W' for i in s]
	for i in range(n - 1):
		if l[i]:
			ind.append(i + 1)
			l[i] = not l[i]
			l[i + 1] = not l[i + 1]
	if not l[-1]:
		print(len(ind))
		print(*ind)
		return
	ind = []
	l = [i == 'B' for i in s]
	for i in range(n - 1):
		if l[i]:
			ind.append(i + 1)
			l[i] = not l[i]
			l[i + 1] = not l[i + 1]
	if not l[-1]:
		print(len(ind))
		print(*ind)
		return
	print(-1)
main()


import sys
import math
import bisect

def solve1(A, ans):
	n = len(A)
	ans.clear()
	for i in range(n - 1):
		if A[i] != 'B':
			A[i] = 'B'
			if A[i + 1] == 'W':
				A[i + 1] = 'B'
			else:
				A[i + 1] = 'W'
			ans.append(i)
	return A[n - 1] == 'B'

def solve2(A, ans):
	n = len(A)
	ans.clear()
	for i in range(n - 1):
		if A[i] != 'W':
			A[i] = 'W'
			if A[i + 1] == 'W':
				A[i + 1] = 'B'
			else:
				A[i + 1] = 'W'
			ans.append(i)
	return A[n - 1] == 'W'

def main():
	n = int(input())
	A = list(input())
	B = A.copy()
	ans = []
	if solve1(B, ans):
		print(len(ans))
		print(' '.join(list((str(a + 1) for a in ans))))
	else:
		B = A.copy()
		if solve2(B, ans):
			print(len(ans))
			print(' '.join(list((str(a + 1) for a in ans))))
		else:
			print(-1)
main()


def swap(l, n, i):
	if l[i] == 'B':
		l[i] = 'W'
	else:
		l[i] = 'B'
	return l

def check(l, n, col):
	if col == 'B':
		for i in l:
			if i == 'W':
				return False
		return True
	else:
		for i in l:
			if i == 'B':
				return False
		return True

def solve(s, n):
	cb = 0
	cw = 0
	ans = list()
	for i in range(n):
		if s[i] == 'W':
			cw += 1
		else:
			cb += 1
	if n % 2 == 0:
		if cb % 2 == 1:
			print(-1)
			return
		else:
			col = 'x'
			if cb > cw:
				col = 'B'
			else:
				col = 'W'
			while not check(s, n, col):
				for i in range(n):
					if s[i] != col:
						s = swap(l, n, i)
						s = swap(l, n, i + 1)
						ans.append(i + 1)
	else:
		col = 'x'
		if cb % 2 == 1:
			col = 'B'
		else:
			col = 'W'
		ans = list()
		while not check(s, n, col):
			for i in range(n):
				if s[i] != col:
					s = swap(l, n, i)
					s = swap(l, n, i + 1)
					ans.append(i + 1)
	print(len(ans))
	for i in range(len(ans)):
		print(ans[i], end=' ')
	print()
n = int(input())
s = input()
l = list()
for i in range(n):
	l.append(s[i])
solve(l, n)


n = int(input())
s = input()
i = 0
a = [i for i in s]
flag = 1
arr1 = []
while i < n:
	if a[i] == 'W':
		i += 1
		continue
	else:
		if i == n - 1:
			flag = 0
			break
		a[i] = 'W'
		if a[i + 1] == 'B':
			a[i + 1] = 'W'
		else:
			a[i + 1] = 'B'
		arr1.append(i + 1)
		i += 1
i = 0
b = [i for i in s]
f = 1
arr2 = []
while i < n:
	if b[i] == 'B':
		i += 1
		continue
	else:
		if i == n - 1:
			f = 0
			break
		b[i] = 'B'
		if b[i + 1] == 'B':
			b[i + 1] = 'W'
		else:
			b[i + 1] = 'B'
		arr2.append(i + 1)
		i += 1
if flag == 1:
	print(len(arr1))
	if len(arr1) > 0:
		print(*arr1)
elif f == 1:
	print(len(arr2))
	if len(arr2) > 0:
		print(*arr2)
else:
	print(-1)


inp = lambda cast=int: [cast(x) for x in input().split()]
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(n,) = inp()
(A,) = inp(str)
b = A.count('B')
w = n - b
A = list(A)
B = A[:]
if b % 2 and w % 2:
	print(-1)
else:
	(res, flag) = (0, False)
	R = []
	for i in range(n - 1):
		if A[i] == 'B':
			(A[i], A[i + 1]) = ('W', 'W' if A[i + 1] == 'B' else 'B')
			res += 1
			R.append(str(i + 1))
	if A[n - 1] == 'B':
		(res, R) = (0, [])
		A = B[:]
		for i in range(n - 1):
			if A[i] == 'W':
				(A[i], A[i + 1]) = ('B', 'B' if A[i + 1] == 'W' else 'W')
				res += 1
				R.append(str(i + 1))
	print(res)
	print(' '.join(R))


n = int(input())
s = input()
a = []
for i in s:
	if i == 'B':
		a.append(0)
	else:
		a.append(1)
ans = []
st = a[0]
for i in range(1, len(s) - 1):
	if a[i] != st:
		a[i] = (a[i] + 1) % 2
		a[i + 1] = (a[i + 1] + 1) % 2
		ans.append(i + 1)
	st = a[i]
if a[n - 1] != a[n - 2] and n % 2 == 1:
	for i in range(0, n - 2, 2):
		a[i] = (a[i] + 1) % 2
		a[i + 1] = (a[i + 1] + 1) % 2
		ans.append(i + 1)
if a.count(1) == n or a.count(0) == n:
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()
else:
	print(-1)


n = int(input())
seq = input()
S = [0 if c == 'W' else 1 for c in seq]
operations = []
if seq.count('W') % 2 == 0:
	for start in range(n - 1):
		if S[start] == 0:
			S[start] = 1 - S[start]
			S[start + 1] = 1 - S[start + 1]
			operations.append(start + 1)
	print(str(len(operations)) + '\n' + ' '.join(map(str, operations)))
elif seq.count('B') % 2 == 0:
	for start in range(n - 1):
		if S[start] == 1:
			S[start] = 1 - S[start]
			S[start + 1] = 1 - S[start + 1]
			operations.append(start + 1)
	print(str(len(operations)) + '\n' + ' '.join(map(str, operations)))
else:
	print(-1)


n = int(input())
s = input()
b = s.count('B')
w = s.count('W')
f = False
count = 0
answer = []
if b % 2 != 0 and w % 2 != 0:
	print(-1)
else:
	if b % 2 != 0:
		i = 0
		while i < n - 1:
			if s[i] == 'W':
				f = True
			if f:
				count += 1
				answer.append(i + 1)
				if s[i + 1] == 'W':
					i += 1
					f = False
			i += 1
	else:
		i = 0
		while i < n - 1:
			if s[i] == 'B':
				f = True
			if f:
				count += 1
				answer.append(i + 1)
				if s[i + 1] == 'B':
					i += 1
					f = False
			i += 1
	print(count)
	print(*answer)


a = int(input())
qqq = input()
b = list(qqq)
ans = []
p = 'B'
q = 'W'
for i in range(len(b) - 1):
	if b[i] != p:
		b[i] = p
		ans.append(i + 1)
		if b[i + 1] == p:
			b[i + 1] = q
		else:
			b[i + 1] = p
if b == list('W' * len(b)) or b == list('B' * len(b)):
	ans.reverse()
	if len(ans) == 0:
		print('0')
	else:
		print(len(ans))
		print(' '.join([str(i) for i in ans]))
	exit(0)
else:
	b = list(qqq)
	ans = []
	p = 'W'
	q = 'B'
	for i in range(len(b) - 1):
		if b[i] != p:
			b[i] = p
			ans.append(i + 1)
			if b[i + 1] == p:
				b[i + 1] = q
			else:
				b[i + 1] = p
	if b == list('W' * len(b)) or b == list('B' * len(b)):
		ans.reverse()
		if len(ans) == 0:
			print('0')
		else:
			print(len(ans))
			print(' '.join([str(i) for i in ans]))
		exit(0)
	else:
		print('-1')
		exit(0)


def f():
	n = int(input())
	d = {'B': 0, 'W': 1}
	line = [d[char] for char in input()]
	if not any(line):
		print(0)
		return
	if all(line):
		print(0)
		return
	modify0 = []
	modify1 = []
	for i in range(n):
		if line[i]:
			modify1.append(i)
		else:
			modify0.append(i)
	modify = None
	if len(modify1) % 2 == 0:
		modify = modify1
	elif len(modify0) % 2 == 0:
		modify = modify0
	if modify is None:
		print(-1)
		return
	m = len(modify)
	ops = []
	for i in range(0, m, 2):
		x = modify[i]
		y = modify[i + 1]
		for ind in range(x, y):
			ops.append((ind, ind + 1))
	print(len(ops))
	print(' '.join((str(op[1]) for op in ops)))
f()


import sys, math, queue, collections
MOD = 10 ** 9 + 7
n = int(input())
s = list(input())
t = s[:]
ans = []
for i in range(n - 1):
	if s[i] == 'W':
		s[i] = 'B'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		ans.append(i + 1)
if len(set(s)) == 1:
	print(len(ans))
	print(*ans)
	exit()
s = t[:]
ans = []
for i in range(n - 1):
	if s[i] == 'B':
		s[i] = 'W'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		ans.append(i + 1)
if len(set(s)) == 1:
	print(len(ans))
	print(*ans)
else:
	print(-1)


n = int(input())
s = input()
t1 = s.count('B')
t2 = s.count('W')
a = [x for x in s]
if t1 % 2 == 1 and t2 % 2 == 1:
	print('-1')
else:
	c = 0
	a1 = []
	b = '#'
	if t2 % 2 == 0:
		b = 'W'
	else:
		b = 'B'
	for i in range(n - 1):
		if a[i] == b:
			c += 1
			if a[i + 1] == 'W':
				a[i + 1] = 'B'
			else:
				a[i + 1] = 'W'
			a1.append(i + 1)
	print(c)
	print(*a1)


def inv(c):
	if c == 'W':
		return 'B'
	else:
		return 'W'
n = int(input())
bs = list(input())
rs = [inv(s) for s in bs]
changes = 0
cindex = []
flag = False
while len(bs) > 2:
	el = len(bs)
	if bs[el - 1] == 'W':
		bs[el - 1] = 'B'
		bs[el - 2] = inv(bs[el - 2])
		changes += 1
		cindex.append(el - 1)
	elif bs[el - 2] == 'B':
		bs.pop()
		bs.pop()
	else:
		bs[el - 2] = 'B'
		bs[el - 3] = inv(bs[el - 3])
		changes += 1
		cindex.append(el - 2)
if bs == ['W', 'W']:
	changes += 1
	cindex.append(1)
elif bs == ['B', 'W'] or bs == ['W', 'B'] or bs == ['W']:
	flag = True
if not flag:
	print(changes)
	if changes != 0:
		print(' '.join((str(i) for i in cindex)))
else:
	bs = rs
	changes = 0
	cindex = []
	flag = False
	while len(bs) > 2:
		el = len(bs)
		if bs[el - 1] == 'W':
			bs[el - 1] = 'B'
			bs[el - 2] = inv(bs[el - 2])
			changes += 1
			cindex.append(el - 1)
		elif bs[el - 2] == 'B':
			bs.pop()
			bs.pop()
		else:
			bs[el - 2] = 'B'
			bs[el - 3] = inv(bs[el - 3])
			changes += 1
			cindex.append(el - 2)
	if bs == ['W', 'W']:
		changes += 1
		cindex.append(1)
	elif bs == ['B', 'W'] or bs == ['W', 'B'] or bs == ['W']:
		flag = True
	if flag:
		print(-1)
	else:
		print(changes)
		if changes != 0:
			print(' '.join((str(i) for i in cindex)))


b = int(input())
s = input()
cb = s.count('B')
cw = s.count('W')
o = ''
co = 0
if cb == 0 or cw == 0:
	print(0)
elif cw % 2 == 0:
	i = 0
	while i != b - 1:
		if s[i] == 'W':
			c = 'B'
			if s[i + 1] == 'W':
				ci = 'B'
			else:
				ci = 'W'
			s = s[:i] + c + ci + s[i + 2:]
			co += 1
			o += str(i + 1)
			o += ' '
		i += 1
	print(co)
	print(o)
elif cb % 2 == 0:
	i = 0
	while i != b - 1:
		if s[i] == 'B':
			c = 'W'
			if s[i + 1] == 'B':
				ci = 'W'
			else:
				ci = 'B'
			s = s[:i] + c + ci + s[i + 2:]
			co += 1
			o += str(i + 1)
			o += ' '
		i += 1
	print(co)
	print(o)
else:
	print(-1)


n = int(input())
s = input()
cnt = list()
x = 0
if s.count('B') % 2 == 1 and s.count('W') % 2 == 1:
	print(-1)
elif s.count('B') % 2 == 0:
	while s.count('B') != 0:
		for i in range(s.find('B') + 1, s[s.find('B') + 1:].find('B') + s.find('B') + 2):
			cnt.append(str(x + i))
		(s, x) = (s[s[s.find('B') + 1:].find('B') + 2 + s.find('B'):], x + s[s.find('B') + 1:].find('B') + s.find('B') + 2)
	print(len(cnt))
	print(' '.join(cnt))
else:
	while s.count('W') != 0:
		for i in range(s.find('W') + 1, s[s.find('W') + 1:].find('W') + s.find('W') + 2):
			cnt.append(str(x + i))
		(s, x) = (s[s[s.find('W') + 1:].find('W') + 2 + s.find('W'):], x + s[s.find('W') + 1:].find('W') + s.find('W') + 2)
	print(len(cnt))
	print(' '.join(cnt))


from collections import Counter
n = int(input())
l = list(input())
x = Counter(l)
if x['B'] % 2 and x['W'] % 2:
	print(-1)
elif x['B'] == n or x['W'] == n:
	print(0)
else:
	k = []
	b = ''
	w = ''
	if not x['B'] % 2:
		b = 'B'
		w = 'W'
	else:
		b = 'W'
		w = 'B'
	t = 0
	while t < n - 1:
		if l[t] == b:
			if l[t + 1] == b:
				k.append(t + 1)
				l[t] = w
				l[t + 1] = w
			elif l[t + 1] == w:
				k.append(t + 1)
				l[t] = w
				l[t + 1] = b
		t += 1
	print(len(k))
	print(*k)


n = int(input())
s = input()
sw = list(s)
sb = list(s)
ans = 0
l = []
for j in range(n - 1):
	if sw[j] == 'B':
		sw[j] = 'W'
		sw[j + 1] = 'W' if sw[j + 1] == 'B' else 'B'
		ans += 1
		l.append(j + 1)
if sw[n - 1] == 'W':
	print(ans)
	print(*l)
else:
	ans = 0
	l = []
	for j in range(n - 1):
		if sb[j] == 'W':
			sb[j] = 'B'
			sb[j + 1] = 'B' if sb[j + 1] == 'W' else 'W'
			ans += 1
			l.append(j + 1)
	if sb[n - 1] == 'B':
		print(ans)
		print(*l)
	else:
		print(-1)


import sys
input = sys.stdin.readline

def sol():
	n = int(input())
	s = list(input())
	b = s.count('B')
	w = s.count('W')
	if w % 2 == 1 and b % 2 == 1:
		print(-1)
		return
	ans = []
	s = list(s)
	if w % 2 == 1:
		odd = 'W'
		even = 'B'
	else:
		odd = 'B'
		even = 'W'
	for i in range(n - 1):
		if s[i] != odd:
			ans.append(i + 1)
			s[i] = odd
			s[i + 1] = even if s[i + 1] == odd else odd
	print(len(ans))
	print(*ans)
sol()


def rev(s):
	if s == 'B':
		return 'W'
	else:
		return 'B'
n = int(input())
s = list(input())
ans = []
if n % 2 == 0:
	if s.count('B') % 2 == 1:
		print(-1)
		exit()
if s.count('B') % 2 == 0:
	i = 0
	while i < n - 1:
		if s[i] == 'B':
			ans.append(i + 1)
			s[i + 1] = rev(s[i + 1])
		i += 1
else:
	i = 0
	while i < n - 1:
		if s[i] == 'W':
			ans.append(i + 1)
			s[i + 1] = rev(s[i + 1])
		i += 1
print(len(ans))
if len(ans) != 0:
	print(*ans)


import collections
n = int(input())
s = input()
b = s.count('B')
w = n - b
if b % 2 and w % 2:
	print(-1)
elif not b or not w:
	print(0)
else:
	ans = []
	if not b % 2:
		for i in range(n - 1):
			if s[i] != 'W':
				ans += [str(i + 1)]
				s = s[:i] + 'W' + 'BW'[s[i + 1] == 'B'] + s[i + 2:]
	elif not w % 2:
		for i in range(n - 1):
			if s[i] != 'B':
				ans += [str(i + 1)]
				s = s[:i] + 'B' + 'WB'[s[i + 1] == 'W'] + s[i + 2:]
	print(len(ans))
	print(' '.join(ans))


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	n = N()
	arr = list(input())
	w = arr.count('W')
	b = n - w
	if w % 2 == 1 and b % 2 == 1:
		print(-1)
	else:
		tar = 'W' if w % 2 == 0 else 'B'
		res = []
		for i in range(n - 1):
			if arr[i] == tar:
				if arr[i + 1] != tar:
					(arr[i], arr[i + 1]) = (arr[i + 1], arr[i])
				else:
					arr[i] = arr[i + 1] = 'B' if tar == 'W' else 'W'
				res.append(i + 1)
		print(len(res))
		print(*res)
main()


n = int(input())
a = input()

def go(s, x):
	b = [1 if c == 'B' else 0 for c in s]
	o = []
	n = len(b)
	for i in range(n):
		if b[i] != x:
			if i + 1 >= n:
				return 0
			o += (i + 1,)
			b[i + 1] = b[i + 1] ^ 1
	print(len(o))
	print(' '.join(map(str, o)))
	return 1
if not go(a, 0) and (not go(a, 1)):
	print(-1)


def main():
	N = int(input())
	P = list(map(lambda x: 0 if x == 'W' else 1, input()))
	for c in range(2):
		PP = P.copy()
		res = []
		for i in range(N - 1):
			if PP[i] != c:
				res.append(i + 1)
				PP[i + 1] = 1 - PP[i + 1]
		if PP[N - 1] == c:
			print(len(res))
			print(' '.join((str(i) for i in res)))
			return
	print('-1')
main()


n = int(input())
s = input().strip()
if s.count('W') == 0 or s.count('B') == 0:
	print(0)
elif s.count('W') % 2 == 1 and s.count('B') % 2 == 1:
	print(-1)
elif s.count('B') % 2 == 0:
	x = []
	for i in range(n):
		if s[i] == 'B':
			x.append(i)
	an = []
	for i in range(0, len(x), 2):
		for j in range(x[i], x[i + 1]):
			an.append(j + 1)
	print(len(an))
	print(*an)
else:
	x = []
	for i in range(n):
		if s[i] == 'W':
			x.append(i)
	an = []
	for i in range(0, len(x), 2):
		for j in range(x[i], x[i + 1]):
			an.append(j + 1)
	print(len(an))
	print(*an)


n = int(input())
l = list(input())
d = {'B': 'W', 'W': 'B'}
ans = []
for i in range(1, len(l) - 1):
	if l[i - 1] != l[i]:
		l[i] = d[l[i]]
		l[i + 1] = d[l[i + 1]]
		ans.append(i + 1)
f = 0
if l[-2] != l[-1]:
	if n & 1:
		for i in range(n - 2, 0, -2):
			ans.append(i)
	else:
		f = 1
		print(-1)
if f == 0:
	if not ans:
		print(0)
	else:
		print(len(ans))
		print(*ans)


n = int(input())
s = list(input().strip())
b = s.count('B')
w = s.count('W')
res = []
if b % 2 and w % 2:
	print(-1)
elif b % 2 == 0:
	i = n - 1
	while i - 1 >= 0:
		if s[i] == 'W':
			i -= 1
		elif s[i] == 'B' and s[i - 1] == 'B':
			res.append(i)
			s[i] = 'W'
			s[i - 1] = 'W'
			i -= 2
		else:
			res.append(i)
			s[i] = 'W'
			s[i - 1] = 'B'
			i -= 1
	print(len(res))
	if len(res):
		print(*res)
else:
	i = n - 1
	while i - 1 >= 0:
		if s[i] == 'B':
			i -= 1
		elif s[i] == 'W' and s[i - 1] == 'W':
			res.append(i)
			s[i] = 'B'
			s[i - 1] = 'B'
			i -= 2
		else:
			res.append(i)
			s[i] = 'B'
			s[i - 1] = 'W'
			i -= 1
	print(len(res))
	if len(res):
		print(*res)


n = int(input())
a = input().strip()
a1 = list(a)
c1 = 0
c2 = 0
x = []
c = 0
for i in a:
	if i == 'B':
		c1 += 1
	elif i == 'W':
		c2 += 1
if c1 == 0 or c2 == 0:
	print(0)
elif c1 % 2 == 1 and c2 % 2 == 1:
	print(-1)
elif c2 >= c1:
	for i in range(n - 1):
		if a1[i] == 'W' and a1[i] == a1[i + 1]:
			a1[i] = 'B'
			a1[i + 1] = 'B'
			c += 1
			x.append(i + 1)
		if a1[i] != a1[i + 1] and a1[i] == 'W':
			a1[i] = 'B'
			a1[i + 1] = 'W'
			x.append(i + 1)
			c += 1
	if a1[n - 1] != a1[n - 2]:
		for jj in range(n - 1, 0, -1):
			if jj % 2:
				x.append(jj)
				c += 1
	if a1[1] != a1[0]:
		for jj in range(1, n):
			if jj % 2 == 0:
				x.append(jj)
				c += 1
	print(c)
	for i in x:
		print(i, end=' ')
elif c1 > c2:
	for i in range(n - 1):
		if a1[i] == 'B' and a1[i] == a1[i + 1]:
			a1[i] = 'W'
			a1[i + 1] = 'W'
			c += 1
			x.append(i + 1)
		if a1[i] != a1[i + 1] and a1[i] == 'B':
			a1[i] = 'W'
			a1[i + 1] = 'B'
			x.append(i + 1)
			c += 1
	if a1[n - 1] != a1[n - 2]:
		for jj in range(n - 1, 0, -1):
			if jj % 2:
				x.append(jj)
				c += 1
	if a1[1] != a1[0]:
		for jj in range(1, n):
			if jj % 2 == 0:
				x.append(jj)
				c += 1
	print(c)
	for i in x:
		print(i, end=' ')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def lessThanX(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def BinarySearch(a, x):
	i = bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def main():
	n = ip()
	p = input()
	w = p.count('W')
	b = p.count('B')
	p = [i for i in p]
	li = []
	c = 0
	if w % 2 == 0:
		for i in range(n - 1):
			if p[i] == 'W':
				p[i] = 'B'
				li.append(i + 1)
				c += 1
				if p[i + 1] == 'B':
					p[i + 1] = 'W'
				else:
					p[i + 1] = 'B'
		print(c)
		print(*li)
	elif b % 2 == 0:
		for i in range(n - 1):
			if p[i] == 'B':
				p[i] = 'W'
				c += 1
				li.append(i + 1)
				if p[i + 1] == 'W':
					p[i + 1] = 'B'
				else:
					p[i + 1] = 'W'
		print(c)
		print(*li)
	else:
		print(-1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
ip = lambda : int(sys.stdin.readline().rstrip('\r\n'))
ai = lambda : list(map(int, sys.stdin.readline().split()))
ei = lambda : map(int, sys.stdin.readline().split())
main()


def abc(l: list):

	def slip(n):
		if l[n] == 'B':
			l[n] = 'W'
		else:
			l[n] = 'B'
		if l[n + 1] == 'B':
			l[n + 1] = 'W'
		else:
			l[n + 1] = 'B'

	def move1():
		for i in range(long - 1):
			if l[i] == choice:
				slip(i)
				out.append(i + 1)
	out = []
	long = len(l)
	b = l.count('B')
	w = l.count('W')
	if b % 2 and w % 2:
		return -1
	if b % 2:
		choice = 'W'
	else:
		choice = 'B'
	move1()
	return out
n = int(input())
s = list(input())
if n == 2:
	if s[0] == s[1]:
		print(0)
	else:
		print(-1)
elif n == 3:
	if s[0] == s[1]:
		if s[1] == s[2]:
			print(0)
		else:
			print('1\n1')
	elif s[1] == s[2]:
		print('1\n2')
	else:
		print('2\n1 2')
elif s.count(s[0]) == len(s):
	print(0)
else:
	ans = abc(s)
	if abc(s) == -1:
		print(-1)
	else:
		print(len(ans))
		print(' '.join(list(map(str, ans))))


a = int(input())
b = input().replace('', ' ').split()
c = ''
k = []
for i in range(a - 1):
	if b[i] == 'B':
		c += 'W'
		b[i] = 'W'
		b[i + 1] = 'BW'[b[i + 1] != 'W']
		k += [i + 1]
	else:
		c += 'W'
if len(c) != len(b):
	c += b[-1]
b = ''.join(c)
if b[-1] == 'W':
	print(len(k))
	print(*k)
elif (a - 1) % 2:
	print(-1)
else:
	print(len(k) + (a - 1) // 2)
	print(*k, *range(1, a, 2))


n = int(input())
s = input()
b = s.count('B')
w = s.count('W')
f = 0
res = 0
ans = []
if b % 2 != 0 and w % 2 != 0:
	print(-1)
else:
	if b % 2 != 0:
		i = 0
		while i < n - 1:
			if s[i] == 'W':
				f = 1
			if f == 1:
				res += 1
				ans.append(i + 1)
				if s[i + 1] == 'W':
					i += 1
					f = 0
			i += 1
	else:
		i = 0
		while i < n - 1:
			if s[i] == 'B':
				f = 1
			if f == 1:
				res += 1
				ans.append(i + 1)
				if s[i + 1] == 'B':
					i += 1
					f = 0
			i += 1
	print(res)
	print(*ans, sep=' ')


import sys
input = sys.stdin.readline
n = int(input())
s = input().rstrip()
bcnt = s.count('B')
wcnt = s.count('W')
if bcnt % 2 == 1 and wcnt % 2 == 1:
	print(-1)
	exit()
s_l = list(s)
ans = []
for i in range(n - 1):
	if s_l[i] == 'W':
		ans.append(i + 1)
		s_l[i] = 'B'
		if s_l[i + 1] == 'B':
			s_l[i + 1] = 'W'
		else:
			s_l[i + 1] = 'B'
if 'W' in s_l:
	for i in range(n - 1):
		if s_l[i] == 'B':
			ans.append(i + 1)
			s_l[i] = 'W'
			if s_l[i + 1] == 'B':
				s_l[i + 1] = 'W'
			else:
				s_l[i + 1] = 'B'
print(len(ans))
print(*ans)


n = int(input())
(B, W) = (0, 0)
s = input()
ss = []
for i in range(0, len(s)):
	ss.append(s[i])
	if s[i] == 'B':
		B = B + 1
	else:
		W = W + 1
if W % 2 == 1 and B % 2 == 1:
	print(-1)
else:
	a = []
	flag = 0
	if B % 2 == 0:
		flag = 1
	elif W % 2 == 0:
		flag = 2
	for i in range(0, len(ss) - 1):
		if ss[i] == 'B':
			if flag == 1:
				ss[i] = 'W'
				if ss[i + 1] == 'B':
					ss[i + 1] = 'W'
				else:
					ss[i + 1] = 'B'
				a.append(i)
		elif ss[i] == 'W':
			if flag == 2:
				ss[i] = 'B'
				if ss[i + 1] == 'B':
					ss[i + 1] = 'W'
				else:
					ss[i + 1] = 'B'
				a.append(i)
	print(len(a))
	for i in range(0, len(a)):
		print(a[i] + 1, end=' ')
	print()


n = int(input())
s = list(str(input()))
temp = s[:]
ans = []
for i in range(n - 1):
	if s[i] == 'B':
		ans.append(i + 1)
		s[i] = 'W'
		s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
if len(set(s)) == 1:
	print(len(ans))
	print(*ans)
else:
	ans = []
	for i in range(n - 1):
		if temp[i] == 'W':
			ans.append(i + 1)
			temp[i] = 'B'
			temp[i + 1] = 'W' if temp[i + 1] == 'B' else 'B'
	if len(set(temp)) == 1:
		print(len(ans))
		print(*ans)
	else:
		print(-1)


def affichage(L):
	for i in range(len(L)):
		L[i] = str(L[i])
	return ' '.join(L)

def executeB(L, n):
	L2 = []
	for i in range(n):
		if L[i] != 'B':
			L[i] = 'W'
			if L[i + 1] == 'B':
				L[i + 1] = 'W'
			else:
				L[i + 1] = 'B'
			L2.append(i + 1)
	print(len(L2))
	if len(L2) > 0:
		print(affichage(L2))

def executeW(L, n):
	L2 = []
	for i in range(n):
		if L[i] != 'W':
			L[i] = 'B'
			if L[i + 1] == 'W':
				L[i + 1] = 'B'
			else:
				L[i + 1] = 'W'
			L2.append(i + 1)
	print(len(L2))
	if len(L2) > 0:
		print(affichage(L2))
n = int(input())
ch = input()
L = [0] * n
for i in range(n):
	L[i] = ch[i]
nbB = 0
nbW = 0
for i in L:
	if i == 'B':
		nbB += 1
	else:
		nbW += 1
if nbB % 2 == 1 and nbW % 2 == 1:
	print(-1)
elif nbB % 2 == 1 and nbW % 2 == 0:
	executeB(L, n)
elif nbB % 2 == 0 and nbW % 2 == 1:
	executeW(L, n)
else:
	L1 = ch.split('B')
	L2 = ch.split('W')
	nb1 = 0
	nb2 = 0
	for i in L1:
		if len(i) > 0 and len(i) % 2 == 0:
			nb1 += 1
	for i in L2:
		if len(i) > 0 and len(i) % 2 == 0:
			nb2 += 1
	if nb1 > nb2:
		executeB(L, n)
	else:
		executeW(L, n)


import math
from collections import defaultdict
ml = lambda : map(int, input().split())
ll = lambda : list(map(int, input().split()))
ii = lambda : int(input())
ip = lambda : input()
mod = 1000000000.0 + 7
t = 1
for _ in range(t):
	n = ii()
	s = ip()
	a = s.count('B')
	b = s.count('W')
	k = 'N'
	if a % 2 == 0:
		k = 'B'
	elif b % 2 == 0:
		k = 'W'
	if k != 'N':
		lol = []
		for i in range(n):
			if s[i] == k:
				lol.append(i + 1)
		ans = []
		for i in range(0, len(lol) - 1, 2):
			for j in range(lol[i], lol[i + 1]):
				ans.append(j)
		print(len(ans))
		print(*ans)
	else:
		print(-1)


n = int(input())
s = list(input())
i = 0
ans = []
ss = s.copy()
while i < n - 1:
	if s[i] == 'B':
		s[i] = 'W'
		s[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
		ans.append(i + 1)
	i += 1
if s.count('B') == 0:
	print(len(ans))
	print(*ans)
else:
	i = 0
	ans = []
	s = ss
	while i < n - 1:
		if s[i] == 'W':
			s[i] = 'B'
			s[i + 1] = 'B' if s[i + 1] == 'W' else 'W'
			ans.append(i + 1)
		i += 1
	if s.count('W') == 0:
		print(len(ans))
		print(*ans)
	else:
		print(-1)


def invert(c):
	if c == 'W':
		return 'B'
	return 'W'

def solve():
	n = int(input())
	s = list(input())
	w = s.count('W')
	b = s.count('B')
	if w % 2 != 0 and b % 2 != 0:
		print(-1)
		return
	if b % 2 == 1:
		ch = 'B'
	else:
		ch = 'W'
	ans = []
	for i in range(len(s) - 1):
		if s[i] != ch:
			s[i] = invert(s[i])
			s[i + 1] = invert(s[i + 1])
			ans.append(i)
	print(len(ans))
	for x in ans:
		print(x + 1, end=' ')
solve()


import sys

def Solve():
	N = int(sys.stdin.readline())
	S = sys.stdin.readline().rstrip()
	S = [0 if a == 'B' else 1 for a in S]
	ops = []

	def Op(i):
		S[i + 1] = S[i + 1] ^ 1
		S[i] = S[i] ^ 1
		ops.append(i)
	for i in range(0, N - 1):
		if S[i]:
			Op(i)
	if S[-1]:
		if sum((1 for i in range(N) if S[i] == 0)) % 2 == 1:
			print(-1)
			return
		for i in range(N // 2):
			Op(i * 2)
	print(len(ops))
	if ops:
		print(' '.join((str(x + 1) for x in ops)))
Solve()


n = int(input())
s = input()
s = [0 if ss == 'W' else 1 for ss in s]
target = sum(s) % 2
count = 0
answer = []
for i in range(len(s) - 1):
	if s[i] != target:
		count += 1
		answer.append(i + 1)
		s[i + 1] = 1 - s[i + 1]
if s[-1] != target:
	print(-1)
else:
	print(count)
	print(' '.join(map(str, answer)))


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(str, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()

def checker(lst):
	value = lst[0]
	for i in range(1, n):
		if lst[i] != value:
			return False
	return True
n = int(input())
string = input()
(lst1, lst2) = ([], [])
for i in string:
	if i == 'W':
		lst1.append(1)
		lst2.append(1)
	else:
		lst1.append(0)
		lst2.append(0)
one = [1] * n
zero = [0] * n
ans = []
for i in range(n - 1):
	if lst1[i] == 1:
		continue
	else:
		lst1[i] = 1
		lst1[i + 1] = lst1[i + 1] ^ 1
		ans.append(i + 1)
if checker(lst1):
	print(len(ans))
	print(*ans)
	exit()
ans = []
for i in range(n - 1):
	if lst2[i] == 0:
		continue
	else:
		lst2[i] = 0
		lst2[i + 1] = lst2[i + 1] ^ 1
		ans.append(i + 1)
if checker(lst2):
	print(len(ans))
	print(*ans)
	exit()
print(-1)


n = int(input())
arr = list(input())
n1 = 0
n2 = 0
for i in arr:
	if i == 'W':
		n1 += 1
	else:
		n2 += 1
if n1 * n2 % 2 == 1:
	print(-1)
elif arr == [arr[0]] * n:
	print(0)
else:
	ans = []
	i = 0
	while arr[i] == 'W':
		i += 1
	while i < n - 1:
		if arr[i] == 'B' and arr[i + 1] == 'B':
			arr[i] = 'W'
			arr[i + 1] = 'W'
			ans.append(i + 1)
			i += 2
		elif arr[i] == 'B' and arr[i + 1] == 'W':
			arr[i] = 'W'
			arr[i + 1] = 'B'
			ans.append(i + 1)
			i += 1
		else:
			i += 1
	if arr[n - 1] == 'B':
		for i in range(0, n - 1, 2):
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


def main():
	n = int(input())
	l = list(input())
	b = l.count('W')
	val = []
	if 'B' not in l or 'W' not in l:
		print(0)
	elif n % 2 == 0 and b % 2 == 1:
		print(-1)
	else:
		if n % 2 == 0:
			for i in range(1, n - 1):
				if l[i - 1] != l[i]:
					l[i] = l[i - 1]
					if l[i + 1] == 'W':
						l[i + 1] = 'B'
					else:
						l[i + 1] = 'W'
					val.append(i + 1)
		else:
			if b % 2 == 0:
				c = 'B'
			else:
				c = 'W'
			for i in range(n - 1):
				if c != l[i]:
					l[i] = c
					if l[i + 1] == 'W':
						l[i + 1] = 'B'
					else:
						l[i + 1] = 'W'
					val.append(i + 1)
		print(len(val))
		for i in range(len(val)):
			print(val[i], end=' ')
		print()
main()


n = int(input())
a = list(input())
w = 0
b = 0
for it in a:
	if it == 'W':
		w += 1
	else:
		b += 1
x = 'W'
y = 'B'
if w % 2 == 1 and b % 2 == 1:
	print(-1)
else:
	if b % 2 == 1:
		x = 'B'
		y = 'W'
	ans = []
	for i in range(n - 1):
		if a[i] != x:
			ans.append(i + 1)
			a[i + 1] = x if a[i + 1] == y else y
	print(len(ans))
	print(' '.join(map(str, ans)))


n = int(input())
s = input()
L = []
n_B = 0
n_W = 0
ans = []
for c in s:
	if c == 'W':
		n_W += 1
		x = 1
	else:
		n_B += 1
		x = 0
	L.append(x)
is_possible = True
if n_B % 2 and n_W % 2:
	is_possible = False
if n_W == 0 or n_B == 0:
	print(0)
elif is_possible:
	for i in range(n - 1):
		if L[i] == 1:
			L[i] = 0
			L[i + 1] = (L[i + 1] + 1) % 2
			ans.append(i + 1)
	if L[-1] == 1:
		for i in range(1, (n + 1) // 2):
			ans.append(2 * i - 1)
	print(len(ans))
	print(*ans)
else:
	print(-1)


n = int(input())
s = input()
b = []
for j in s:
	b.append(j)
res = []
j = 0
while j < n - 1:
	if b[j] == 'B' and b[j + 1] == 'W':
		(b[j], b[j + 1]) = (b[j + 1], b[j])
		res.append(j + 1)
		j += 1
	elif b[j] == 'B' and b[j + 1] == 'B':
		b[j] = 'W'
		b[j + 1] = 'W'
		res.append(j + 1)
		j += 2
	else:
		j += 1
if len(set(b)) == 1:
	print(len(res))
	print(*res)
elif len(b) % 2 != 0:
	j = 0
	while j < n - 1:
		res.append(j + 1)
		j += 2
	print(len(res))
	print(*res)
else:
	print(-1)


n = int(input())
s = list(input())
blacks = s.count('B')
whites = n - blacks
operations = []
if blacks & 1 == whites & 1 == 1:
	print(-1)
	exit()
elif blacks & 1 == 1:
	i = 0
	while i < n:
		if s[i] == 'W':
			operations.append(i + 1)
			s[i] = 'B'
			if i + 1 < n:
				if s[i + 1] == 'W':
					s[i + 1] = 'B'
				else:
					s[i + 1] = 'W'
		i += 1
else:
	i = 0
	while i < n:
		if s[i] == 'B':
			operations.append(i + 1)
			s[i] = 'W'
			if i + 1 < n:
				if s[i + 1] == 'B':
					s[i + 1] = 'W'
				else:
					s[i + 1] = 'B'
		i += 1
print(len(operations))
for x in operations:
	print(x, end=' ')


n = int(input())
s = list(input())
c1 = s.count('B')
c2 = s.count('W')
if c1 % 2 == 1 and c2 % 2 == 1:
	print(-1)
else:
	x = 'W' if c2 % 2 == 0 else 'B'
	q = 0
	c = 0
	a = []
	for i in range(n):
		if s[i] == x and q == 0 or (s[i] != x and q == 1):
			q = 1
			c += 1
			a.append(i + 1)
		else:
			q = 0
	print(c)
	print(*a)


import sys
n = int(input())
s = list(map(lambda x: 0 if x == 'B' else 1, list(input().strip())))

def flip(index):
	if s[index] == 0:
		s[index] = 1
	else:
		s[index] = 0
out = []
for i in range(1, len(s) - 1):
	if s[i] == s[0]:
		continue
	flip(i)
	flip(i + 1)
	out.append(i + 1)
if s[-1] == s[0]:
	print(len(out))
	print(*out)
elif (n - 1) % 2 != 0:
	print(-1)
else:
	for i in range(n - 3, -1, -2):
		out.append(i + 1)
	print(len(out))
	print(*out)


n = int(input())
s = [int(i == 'B') for i in input()]
b = sum(s)
w = n - b
if w * b == 0:
	print(0)
elif w % 2 and b % 2:
	print(-1)
else:
	target = 1 if b % 2 == 0 else 0
	ans = []
	for i in range(n - 1):
		if s[i] == target:
			ans.append(i + 1)
			s[i + 1] ^= 1
	print(len(ans))
	print(*ans)


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
a = []
for x in range(n):
	a.append(s[x])
steps = []
ans = 'YES'
for i in range(n - 1):
	if a[i] == 'B':
		a[i] = 'W'
		if a[i + 1] == 'B':
			a[i + 1] = 'W'
		else:
			a[i + 1] = 'B'
		steps.append(str(i + 1))
cont = 0
for p in range(n):
	if a[p] == 'B':
		cont = 1
		break
if cont == 1:
	for q in range(n - 1):
		if a[q] == 'W':
			a[q] = 'B'
			if a[q + 1] == 'B':
				a[q + 1] = 'W'
			else:
				a[q + 1] = 'B'
			steps.append(str(q + 1))
	for r in range(n):
		if a[r] == 'W':
			ans = 'NO'
			break
if ans == 'NO':
	print(-1)
else:
	print(len(steps))
	if len(steps) > 0:
		print(' '.join(steps))


n = int(input())
s = input()
arr = [x for x in s]
B = arr.count('B')
W = arr.count('W')
if not B or not W:
	print(0)
elif B & 1 and W & 1:
	print(-1)
else:
	ans = []
	if B % 2 == 0:
		for x in range(n - 1):
			if arr[x] == 'B':
				if arr[x + 1] == 'B':
					ans.append(x)
					arr[x] = 'W'
					arr[x + 1] = 'W'
				else:
					ans.append(x)
					arr[x] = 'W'
					arr[x + 1] = 'B'
	else:
		for x in range(n - 1):
			if arr[x] == 'W':
				if arr[x + 1] == 'W':
					ans.append(x)
					arr[x] = 'B'
					arr[x + 1] = 'B'
				else:
					ans.append(x)
					arr[x] = 'B'
					arr[x + 1] = 'W'
	print(len(ans))
	for x in ans:
		print(x + 1, end=' ')


n = int(input())
l = list(input())
z = 'W'
ans = []
for i in range(n - 1):
	if l[i] != z:
		l[i] = z
		l[i + 1] = 'W' if l[i + 1] == 'B' else 'B'
		ans.append(i + 1)
if l != ['W'] * n:
	z = 'B'
	for i in range(n - 1):
		if l[i] != z:
			l[i] = z
			l[i + 1] = 'W' if l[i + 1] == 'B' else 'B'
			ans.append(i + 1)
	if l != [z] * n:
		print(-1)
	else:
		print(len(ans))
		for i in range(len(ans)):
			print(ans[i], end=' ')
else:
	print(len(ans))
	for i in range(len(ans)):
		print(ans[i], end=' ')


from collections import Counter
n = int(input())
s = input()
rr = None
for x in 'BW':
	res = []
	toggle = False
	for (i, v) in enumerate(s):
		if v == x:
			toggle = not toggle
		if toggle:
			res.append(i + 1)
	if not toggle and (rr is None or len(res) < len(rr)):
		rr = res
if rr is None:
	print(-1)
else:
	print(len(rr))
	print(*rr)


n = int(input())
s = list(input())
k = sum([1 for i in s if i == 'B'])
if n % 2 == 0 and k % 2 == 1:
	print(-1)
else:
	color = s[0] if n % 2 == 0 else 'B' if k % 2 == 1 else 'W'
	moves = []
	for i in range(n):
		if s[i] == color:
			continue
		else:
			moves.append(str(i + 1))
			s[i] = 'W' if s[i] == 'B' else 'B'
			s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
	print(len(moves))
	print(' '.join(moves))


import os, sys, math
import collections
if os.path.exists('testing'):
	name = os.path.basename(__file__)
	if name.endswith('.py'):
		name = name[:-3]
	src = open(name + '.txt', encoding='utf8')
	input = src.readline

def solve():
	result = []
	data = [1 if q == 'W' else 0 for q in n]
	count = 0
	for x in range(len(data)):
		v = data[x]
		if v == 0:
			count += 1
			if x + 1 < len(data) and data[x + 1] == 0:
				count -= 2
	if count % 2:
		if len(data) % 2 == 0:
			return None
		data = [1 - q for q in data]
	for x in range(len(data)):
		if data[x] == 0:
			result.append(x)
			data[x] = 1
			if x + 1 == len(data):
				assert False
				return None
			data[x + 1] = 1 - data[x + 1]
	return result
s = int(input().strip())
n = input().strip()
res = solve()
if res is None:
	print(-1)
else:
	print(len(res))
	print(' '.join(map(str, (q + 1 for q in res))))


n = int(input())
L = input()
c1 = 'W'
c2 = 'B'
WC = L.count(c1)
BC = L.count(c2)
s = [x for x in L]
if WC % 2 == 1 and BC % 2 == 1:
	print(-1)
	exit()
if WC == n or BC == n:
	print(0)
	exit()
count1 = []
if WC % 2 == 1 and BC % 2 == 0:
	for i in range(len(s) - 1):
		if s[i] == c2:
			count1.append(i + 1)
			s[i] = c1
			if s[i + 1] == c1:
				s[i + 1] = c2
			else:
				s[i + 1] = c1
	count1 = set(count1)
	print(len(count1))
	for x in count1:
		print(x, end=' ')
	print()
elif WC % 2 == 0:
	for i in range(len(s) - 1):
		if s[i] == c1:
			count1.append(i + 1)
			s[i] = c2
			if s[i + 1] == c1:
				s[i + 1] = c2
			else:
				s[i + 1] = c1
	count1 = set(count1)
	print(len(count1))
	for x in count1:
		print(x, end=' ')
	print()


n = int(input())
s = list(input())
out = []
if s.count('B') == n or s.count('W') == n:
	print(0)
	exit()
for i in range(n - 1):
	if s[i] == 'W':
		s[i] = 'B'
		out.append(i + 1)
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
if s.count('B') == n:
	print(len(out))
	print(' '.join(map(str, out)))
	exit()
for i in range(n - 1):
	if s[i] == 'B':
		s[i] = 'W'
		out.append(i + 1)
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
if s.count('W') == n:
	print(len(out))
	print(' '.join(map(str, out)))
else:
	print(-1)


n = int(input())
s = list(input())
cnt_b = 0
cnt_w = 0
for i in range(n):
	if s[i] == 'B':
		cnt_b += 1
	if s[i] == 'W':
		cnt_w += 1
if cnt_b % 2 == 1 and cnt_w % 2 == 1:
	print(-1)
	exit()
if cnt_b % 2 == 0:
	num = 0
	ans = []
	for i in range(n):
		if s[i] == 'B':
			num += 1
			ans.append(i + 1)
			s[i] = 'W'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
else:
	num = 0
	ans = []
	for i in range(n):
		if s[i] == 'W':
			num += 1
			ans.append(i + 1)
			s[i] = 'B'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
print(num)
if num != 0:
	print(*ans)


from itertools import product
n = int(input())
s = list(input())
d = {'B': 0, 'W': 1}
(c1, c2) = (0, 0)
for i in range(len(s)):
	if s[i] == 'B':
		c1 += 1
	else:
		c2 += 1
	s[i] = d[s[i]]
ans = []
if c1 & 1 and c2 & 1:
	print(-1)
else:
	for i in reversed(range(1, len(s) - 1)):
		if s[i] != s[i + 1]:
			s[i] ^= 1
			s[i - 1] ^= 1
			ans.append(i)
	if s[0] != s[1]:
		for i in range(2, len(s), 2):
			ans.append(i)
	if not ans:
		print(0)
	else:
		print(len(ans))
		print(*ans)


N = int(input())
S_raw = input()
S = [0] * N
for i in range(N):
	if S_raw[i] == 'B':
		S[i] = 1
S_ori = S[:]
ans = []
for i in range(N - 1):
	if S[i] == 1:
		S[i] = 0
		S[i + 1] = 1 - abs(S[i + 1])
		ans.append(i + 1)
if S[-1] == 0:
	print(len(ans))
	print(*ans)
	exit()
S = S_ori[:]
ans = []
for i in range(N - 1):
	if S[i] == 0:
		S[i] = 1
		S[i + 1] = 1 - abs(S[i + 1])
		ans.append(i + 1)
if S[-1] == 1:
	print(len(ans))
	print(*ans)
else:
	print(-1)


n = int(input())
k = list(input())
b = k.count('B')
t = n - b
count = 0
a = []
if b % 2 != 0 and t % 2 != 0:
	print(-1)
elif b == 0 or t == 0:
	print(0)
else:
	c = ''
	q = 1
	if b % (1 + 1) == 0:
		while q < n:
			if k[q] == 'B' and k[q - 1] == 'B':
				k[q] = k[q - 1] = 'W'
				c += str(q) + ' '
				q += 1
				count += 1
			elif k[q - 1] == 'B' and k[q] == 'W':
				k[q - 1] = 'W'
				k[q] = 'B'
				c += str(q) + ' '
				q += 1
				count += 1
			elif k[q] == 'W' and k[q - 1] == 'W':
				q += 1
			else:
				q += 1
	else:
		while q < n:
			if k[q] == 'W' and k[q - 1] == 'W':
				k[q] = k[q - 1] = 'B'
				c += str(q) + ' '
				q += 1
				count += 1
			elif k[q] == 'B' and k[q - 1] == 'W':
				k[q] = 'W'
				k[q - 1] = 'B'
				c += str(q) + ' '
				q += 1
				count += 1
			elif k[q] == 'B' and k[q - 1] == 'B':
				q += 1
			else:
				q += 1
	print(count)
	print(c)


n = int(input())
l = input()
s = [l[i:i + 1] for i in range(len(l))]
path = []
temp = 'B'
for i in range(len(s)):
	if i < n - 1:
		if s[i] != temp:
			path.append(i)
			if s[i + 1] != temp:
				s[i + 1] = temp
			else:
				s[i + 1] = 'W'
			s[i] = temp
flag = 0
for i in range(len(s)):
	if i < n - 1:
		if s[i] != s[i + 1]:
			flag = 1
			break
if flag == 0:
	print(len(path))
	for i in path:
		print(i + 1, end=' ')
else:
	temp = 'W'
	for i in range(len(s)):
		if i < n - 1:
			if s[i] != temp:
				path.append(i)
				if s[i + 1] != temp:
					s[i + 1] = temp
				else:
					s[i + 1] = 'B'
				s[i] = temp
	flag = 0
	for i in range(len(s)):
		if i < n - 1:
			if s[i] != s[i + 1]:
				flag = 1
				break
	if flag == 0:
		print(len(path))
		for i in path:
			print(i + 1, end=' ')
	else:
		print(-1)


def main():
	nos = int(input())
	p = input()
	pattern = list(p)
	bcount = pattern.count('B')
	wcount = pattern.count('W')
	if bcount % 2 != 0 and wcount % 2 != 0:
		print(-1)
		return 0
	count = 0
	steps = []
	if bcount % 2 == 0:
		i = 0
		while i < len(pattern) - 1:
			if pattern[i] == 'B' and pattern[i + 1] == 'W':
				count += 1
				steps.append(i + 1)
				temp = pattern[i]
				pattern[i] = pattern[i + 1]
				pattern[i + 1] = temp
				i += 1
			elif pattern[i] == pattern[i + 1]:
				i += 2
			else:
				i += 1
		i = 0
		for i in range(len(pattern) - 1):
			if pattern[i] == 'B' and pattern[i + 1] == 'B':
				count += 1
				pattern[i] = 'W'
				pattern[i + 1] = 'W'
				steps.append(i + 1)
	else:
		i = 0
		while i < len(pattern) - 1:
			if pattern[i] == 'W' and pattern[i + 1] == 'B':
				count += 1
				steps.append(i + 1)
				temp = pattern[i]
				pattern[i] = pattern[i + 1]
				pattern[i + 1] = temp
				i += 1
			elif pattern[i] == pattern[i + 1]:
				i += 2
			else:
				i += 1
		for i in range(len(pattern) - 1):
			if pattern[i] == 'W' and pattern[i + 1] == 'W':
				count += 1
				pattern[i] = 'B'
				pattern[i + 1] = 'B'
				steps.append(i + 1)
	print(count)
	if count > 0:
		for i in steps:
			print(i, end=' ')
		print('')
main()


n = int(input())
blocks = str(input())
count_b = sum([1 for i in blocks if i == 'B'])
count_w = sum([1 for i in blocks if i == 'W'])
if count_b % 2 != 0 and count_w % 2 != 0:
	print(-1)
elif count_b == 0 or count_w == 0:
	print(0)
else:
	ans = []
	blocks = list(blocks)
	blocks += '1'
	while count_w > 1:
		for (idx, each) in enumerate(blocks):
			next_each = idx + 1
			if each == 'W' and blocks[next_each] != '1':
				blocks[idx] = 'B'
				blocks[next_each] = 'W' if blocks[next_each] == 'B' else 'B'
				ans.append(str(next_each))
				break
		count_w = sum([1 for i in blocks if i == 'W'])
	if count_w >= 1:
		while count_b > 1:
			for (idx, each) in enumerate(blocks):
				next_each = idx + 1
				if each == 'B' and blocks[next_each] != '1':
					blocks[idx] = 'W'
					blocks[next_each] = 'B' if blocks[next_each] == 'W' else 'W'
					ans.append(str(next_each))
					break
			count_b = sum([1 for i in blocks if i == 'B'])
	print(len(ans))
	print(' '.join(ans))


def main():
	n = int(input())
	sa = input()
	s = list(sa)
	if len(set(s)) == 1:
		print(0)
		return
	a = []
	for i in range(n - 1):
		if s[i] == 'W' and s[i + 1] == 'B':
			s[i] = 'B'
			s[i + 1] = 'W'
			a.append(i + 1)
		elif s[i] == 'W' and s[i + 1] == 'W':
			a.append(i + 1)
			s[i] = 'B'
			s[i + 1] = 'B'
	if len(set(s)) == 1:
		print(len(a))
		print(*a)
		return
	s = list(sa)
	a = []
	for i in range(n - 1):
		if s[i] == 'B' and s[i + 1] == 'W':
			s[i] = 'W'
			s[i + 1] = 'B'
			a.append(i + 1)
		elif s[i] == 'B' and s[i + 1] == 'B':
			a.append(i + 1)
			s[i] = 'W'
			s[i + 1] = 'W'
	if len(set(s)) == 1:
		print(len(a))
		print(*a)
		return
	print(-1)
	return
main()


t = int(input())
l = list(input())
B = l.count('B')
W = l.count('W')
ll = []
c = l.copy()
if t % 2 == 0:
	if B % 2 != 0 or W % 2 != 0:
		print('-1')
	elif W == t or B == t:
		print(0)
	else:
		for i in range(t - 1):
			if l[i] != 'W':
				ll.append(i + 1)
				if l[i + 1] == 'B':
					l[i + 1] = 'W'
				else:
					l[i + 1] = 'B'
		if l[-1] == 'B':
			ll = []
			for i in range(t - 1):
				if c[i] != 'B':
					ll.append(i + 1)
					if c[i + 1] == 'W':
						l[i + 1] = 'B'
					else:
						c[i + 1] = 'W'
		print(len(ll))
		print(*ll)
elif W == t or B == t:
	print(0)
else:
	for i in range(t - 1):
		if l[i] != 'W':
			ll.append(i + 1)
			if l[i + 1] == 'B':
				l[i + 1] = 'W'
			else:
				l[i + 1] = 'B'
	if l[t - 1] == 'B':
		ll = []
		for j in range(t - 1):
			if c[j] != 'B':
				ll.append(j + 1)
				if c[j + 1] == 'B':
					c[j + 1] = 'W'
				else:
					c[j + 1] = 'B'
	print(len(ll))
	print(*ll)


n = int(input())
string = input()
sequence = [0] * n
for i in range(n):
	if string[i] == 'B':
		sequence[i] = -1
	else:
		sequence[i] = 1

def Try(char, seq):
	commands = []
	count = 0
	for i in range(n - 1):
		if seq[i] != char:
			seq[i] = char
			seq[i + 1] *= -1
			commands.append(i + 1)
			count += 1
	if seq[-1] != char:
		if n % 2 == 0:
			return None
		else:
			for j in range(1, n - 1, 2):
				count += 1
				commands.append(j)
			return [count, commands]
	else:
		return [count, commands]
s2 = sequence.copy()
r = Try(1, sequence)
if not r:
	r = Try(-1, s2)
	if not r:
		print(-1)
	else:
		print(r[0])
		for rr in r[1]:
			print(rr, end=' ')
else:
	if r[0] > n:
		r2 = Try(-1, s2)
		if r2:
			r = r2
	print(r[0])
	for rr in r[1]:
		print(rr, end=' ')


n = int(input())
s = list(input())
count = 0
l = []
cb = 0
cw = 0

def swap(char):
	if char == 'W':
		return 'B'
	else:
		return 'W'
for i in range(len(s)):
	if s[i] == 'B':
		cb += 1
	else:
		cw += 1
if cb % 2 != 0 and cw % 2 != 0:
	print(-1)
elif cb == 0 or cw == 0:
	print(0)
else:
	for i in range(len(s) - 1):
		if s[i] == 'B':
			s[i] = swap(s[i])
			cw += 1
			cb -= 1
			s[i + 1] = swap(s[i + 1])
			l.append(i + 1)
			if s[i + 1] == 'B':
				cb += 1
				cw -= 1
			else:
				cw += 1
				cb -= 1
		if cb == 0 or cw == 0:
			break
	if cb != 0 and cw != 0:
		for i in range(len(s) - 1):
			if s[i] == 'W':
				s[i] = swap(s[i])
				cw -= 1
				cb += 1
				s[i + 1] = swap(s[i + 1])
				l.append(i + 1)
				if s[i + 1] == 'B':
					cb += 1
					cw -= 1
				else:
					cw += 1
					cb -= 1
			if cb == 0 or cw == 0:
				break
	print(len(l))
	print(*l)


from collections import Counter

def flip_colors(s, i):
	if s[i] == 'W':
		s[i] = 'B'
	else:
		s[i] = 'W'
n = int(input())
s = list(input())
wb = Counter(s)
if wb['W'] < wb['B']:
	min_wb = wb['W']
	min_wb_color = 'W'
else:
	min_wb = wb['B']
	min_wb_color = 'B'
if n % 2 == 0 and min_wb % 2 == 1:
	print(-1)
else:
	ans = 0
	ans_seq = []
	for i in range(1, n):
		if s[i - 1] == min_wb_color:
			ans_seq.append(i - 1 + 1)
			ans += 1
			flip_colors(s, i - 1)
			flip_colors(s, i)
	if s[i - 1] != s[i]:
		for i in range(0, n - 1, 2):
			ans_seq.append(i + 1)
			ans += 1
	print(ans)
	print(' '.join(map(str, ans_seq)))


l = int(input())
s = list(input())
counts = {'B': 0, 'W': 0}
for i in range(l):
	counts[s[i]] += 1
if counts['B'] % 2 == 1 and counts['W'] % 2 == 1:
	print(-1)
	exit(0)
if counts['B'] % 2 == 0:
	c = 'B'
	ci = 'W'
elif counts['W'] % 2 == 0:
	c = 'W'
	ci = 'B'
actions = []
for i in range(l - 1):
	if s[i] == c:
		actions.append(i + 1)
		s[i] = ci
		if s[i + 1] == c:
			s[i + 1] = ci
		elif s[i + 1] == ci:
			s[i + 1] = c
print(len(actions))
if len(actions) > 0:
	print(*actions)


n = int(input())
a = list(input())
q = a.copy()
ans = []
count = 0
for i in range(n - 1):
	if a[i] == 'W' and a[i + 1] == 'B':
		a[i] = 'B'
		a[i + 1] = 'W'
		ans.append(i + 1)
		count = count + 1
	elif a[i] == 'W' and a[i + 1] == 'W':
		a[i] = 'B'
		a[i + 1] = 'B'
		ans.append(i + 1)
		count = count + 1
if a[n - 1] == 'B':
	print(count)
	ans = ' '.join(list(map(str, ans)))
	print(ans)
else:
	count = 0
	ans = []
	a = q
	for i in range(n - 1):
		if a[i] == 'B' and a[i + 1] == 'W':
			a[i] = 'W'
			a[i + 1] = 'B'
			ans.append(i + 1)
			count = count + 1
		elif a[i] == 'B' and a[i + 1] == 'B':
			a[i] = 'W'
			a[i + 1] = 'W'
			ans.append(i + 1)
			count = count + 1
	if a[n - 1] == 'W':
		print(count)
		ans = ' '.join(list(map(str, ans)))
		print(ans)
	else:
		print('-1')


from sys import stdin, stdout
from collections import deque
input = stdin.readline
n = int(input())
seqB = list(input())
seqW = seqB.copy()
for i in range(0, n):
	if seqB[i] == 'B':
		seqB[i] = True
		seqW[i] = False
	else:
		seqB[i] = False
		seqW[i] = True
opsB = deque()
opsW = deque()
for i in range(0, n - 1):
	if not seqB[i]:
		seqB[i] = not seqB[i]
		seqB[i + 1] = not seqB[i + 1]
		opsB.append(i + 1)
for i in range(0, n - 1):
	if not seqW[i]:
		seqW[i] = not seqW[i]
		seqW[i + 1] = not seqW[i + 1]
		opsW.append(i + 1)
if not seqB[n - 1]:
	if not seqW[n - 1]:
		print(-1)
	else:
		print(len(opsW))
		print(*opsW)
else:
	print(len(opsB))
	print(*opsB)


def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))
n = int(input())
s = input()
if s.count('B') % 2 != n % 2 and s.count('W') % 2 != n % 2:
	print(-1)
else:
	if s.count('B') % 2 != n % 2:
		s2 = []
		for x in s:
			if x == 'B':
				s2.append('W')
			else:
				s2.append('B')
		s = ''.join(s2)
	arr = list(s)
	ans = []
	for i in range(n - 1):
		if arr[i] == 'W':
			ans.append(i + 1)
			if arr[i + 1] == 'W':
				arr[i + 1] = 'B'
			else:
				arr[i + 1] = 'W'
	print(len(ans))
	oneLineArrayPrint(ans)


n = int(input())
s = list(input())
Nb = 0
Nw = 0
for i in s:
	if i == 'W':
		Nw += 1
	elif i == 'B':
		Nb += 1
if Nb % 2 == 1 and Nw % 2 == 1:
	print(-1)
elif Nb == 0 or Nw == 0:
	print(0)
else:
	ans = ''
	count = 0
	WB = ['W', 'B']
	tmp = [0, 1][Nb % 2 == 0]
	for i in range(n - 1):
		if s[i] == WB[tmp]:
			s[i] = WB[1 - tmp]
			count += 1
			ans += str(i + 1) + ' '
			s[i + 1] = WB[s[i + 1] == 'W']
	print(count)
	print(ans[:-1])


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solve():

	def invert(i):
		dic = {'W': 'B', 'B': 'W'}
		s[i] = dic[s[i]]
		s[i + 1] = dic[s[i + 1]]
	n = int(input())
	s = list(input())
	c = Counter(s)

	def invert(i):
		dic = {'W': 'B', 'B': 'W'}
		s[i] = dic[s[i]]
		s[i + 1] = dic[s[i + 1]]
	if c['W'] == n:
		print(0)
		return
	elif c['B'] == n:
		print(0)
		return
	elif c['W'] % 2 and c['B'] % 2:
		print(-1)
		return
	elif not (c['W'] % 2 or c['B'] % 2):
		k = 0
		ans = []
		for i in range(n):
			if s[i] != 'B':
				invert(i)
				k += 1
				ans.append(i + 1)
		print(k)
		print(*ans)
	else:
		col = 'B' if c['B'] % 2 == 1 else 'W'
		k = 0
		ans = []
		for i in range(n):
			if s[i] != col:
				invert(i)
				k += 1
				ans.append(i + 1)
		print(k)
		print(*ans)
solve()


n = int(input())
p = list(input())
pp = p[:]
ans = []
for i in range(n - 1):
	if pp[i] == 'W':
		ans.append(i + 1)
		if pp[i + 1] == 'W':
			pp[i + 1] = 'B'
		else:
			pp[i + 1] = 'W'
if pp[-1] == 'B':
	print(len(ans))
	print(*ans)
	exit(0)
pp = p[:]
ans = []
for i in range(n - 1):
	if pp[i] == 'B':
		ans.append(i + 1)
		if pp[i + 1] == 'W':
			pp[i + 1] = 'B'
		else:
			pp[i + 1] = 'W'
if pp[-1] == 'W':
	print(len(ans))
	print(*ans)
	exit(0)
print(-1)


I = input
n = int(I())
s = list(I())
b = []
w = []
for i in range(n):
	if s[i] == 'W':
		w.append(i + 1)
	else:
		b.append(i + 1)
bc = len(b)
wc = len(w)
ans = []
q = -1
if bc == 0 and bc == n:
	print(0)
elif wc == 0 and wc == n:
	print(0)
else:
	if bc % 2 != 0:
		if wc % 2 != 0:
			q = 0
			print(-1)
		elif bc == 1:
			for i in range(b[0] - 1, 0, -1):
				ans.append(i)
			for i in range(2, n, 2):
				ans.append(i)
		else:
			for i in range(1, bc, 2):
				st = b[i]
				en = b[i + 1]
				for j in range(en - 1, st - 1, -1):
					ans.append(j)
			for i in range(b[0] - 1, 0, -1):
				ans.append(i)
			for i in range(2, n, 2):
				ans.append(i)
	else:
		for i in range(0, bc, 2):
			st = b[i]
			en = b[i + 1]
			for j in range(en - 1, st - 1, -1):
				ans.append(j)
	if q == -1:
		print(len(ans))
		for i in ans:
			print(i, end=' ')


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
n = inn()
a = [str(x) for x in input()]
ans = []
i = 0
res = a[0]
flag = 0
while i < n and a[i] == res:
	i += 1
while i < n:
	if a[i] == res:
		i += 1
		continue
	val = a[i]
	j = i
	while i < n and val == a[i]:
		i += 1
	if (i - j) % 2 == 0:
		ans += [k + 1 for k in range(j, i, 2)]
		a[i - 1] = res
	else:
		ans += [k + 1 for k in range(j, min(i - 1, n - 1), 2)]
		if j < n - 1 and i < n:
			ans += [i]
		while i < n - 1 and a[i] == res:
			ans += [i + 1]
			i += 1
		if i == n - 1:
			if a[i] == res:
				flag = 1
				break
			else:
				a[i] = res
		i += 1
if flag == 0 and a[-1] == res:
	print(len(ans))
	print(*ans)
elif len(a) % 2 == 0:
	print(-1)
else:
	ans += [k + 1 for k in range(0, n - 1, 2)]
	print(len(ans))
	print(*ans)


n = int(input())
word = input()
arr = list(map(str, word))
if word == n * 'B':
	print(0)
elif word == n * 'W':
	print(0)
else:
	ans = []
	for i in range(n - 1):
		if arr[i] == 'B':
			ans.append(i + 1)
			arr[i] = 'W'
			if arr[i + 1] == 'W':
				arr[i + 1] = 'B'
			else:
				arr[i + 1] = 'W'
	final = ''.join((str(x) for x in arr))
	if final == 'W' * n:
		print(len(ans))
		print(*ans)
	else:
		for i in range(n - 1):
			if arr[i] == 'W':
				ans.append(i + 1)
				arr[i] = 'B'
				if arr[i + 1] == 'B':
					arr[i + 1] = 'W'
				else:
					arr[i + 1] = 'B'
		final = ''.join((str(x) for x in arr))
		if final == 'B' * n:
			print(len(ans))
			print(*ans)
		else:
			print(-1)


n = int(input())
s = input()
ar = list(s)
br = list(s)
b = 0
w = 0
for i in ar:
	if i == 'B':
		b += 1
	else:
		w += 1
ans = []
ans1 = []
count = 0
flag = 0
if b == 0 or w == 0:
	print('0')
else:
	for i in range(n):
		if i == n - 1:
			break
		if ar[i] == ar[i + 1]:
			if ar[i] == 'B':
				continue
			else:
				ar[i] = 'B'
				ar[i + 1] = 'B'
				count += 1
				ans.append(i + 1)
		elif ar[i] == 'W':
			ar[i] = 'B'
			ar[i + 1] = 'W'
			ans.append(i + 1)
			count += 1
	for i in range(n):
		if i == n - 1:
			break
		if br[i] == br[i + 1]:
			if br[i] == 'W':
				continue
			else:
				br[i] = 'W'
				br[i + 1] = 'W'
				flag += 1
				ans1.append(i + 1)
		elif br[i] == 'B':
			br[i] = 'W'
			br[i + 1] = 'B'
			ans1.append(i + 1)
			flag += 1
	if ar[n - 1] != ar[n - 2] and br[n - 1] != br[n - 2]:
		print('-1')
	elif ar[n - 1] == ar[n - 2]:
		print(count)
		for i in ans:
			print(i, end=' ')
	else:
		print(flag)
		for i in ans1:
			print(i, end=' ')


x = int(input())
y = input()
out = list()
printo = list()
for i in range(len(y)):
	if y[i] == 'W':
		out.append(1)
	else:
		out.append(0)
if out.count(0) % 2 == 0 or out.count(1) % 2 == 0:
	for j in range(len(out) - 1):
		if out[j] % 2 != out[0] % 2:
			out[j] += 1
			out[j + 1] += 1
			printo.append(str(j + 1))
	for k in range(len(out) - 1, 0, -1):
		if out[k] % 2 != out[len(out) - 1] % 2:
			out[k] += 1
			out[k - 1] += 1
			printo.append(str(k))
	print(len(printo))
	print(' '.join(printo))
else:
	print(-1)


n = int(input())
s = input()
b = s.count('B')
w = n - b
if b & 1 and w & 1 and (n % 2 == 0):
	print(-1)
elif n & 1:
	d = {'W': 'B', 'B': 'W'}
	c = {'W': w, 'B': b}
	s = list(s)
	if b & 1:
		t = 'W'
	else:
		t = 'B'
	i = 0
	p = []
	while c[t] != 0:
		i %= n - 1
		if s[i] == t:
			if s[i] == s[i + 1]:
				c[t] -= 2
			s[i] = d[t]
			s[i + 1] = d[s[i + 1]]
			p += (i + 1,)
		i += 1
	print(len(p))
	print(*p)
else:
	d = {'W': 'B', 'B': 'W'}
	c = {'W': w, 'B': b}
	s = list(s)
	if b > w:
		t = 'W'
	else:
		t = 'B'
	i = 0
	p = []
	while c[t] != 0:
		i %= n - 1
		if s[i] == t:
			if s[i] == s[i + 1]:
				c[t] -= 2
			s[i] = d[t]
			s[i + 1] = d[s[i + 1]]
			p += (i + 1,)
		i += 1
	print(len(p))
	print(*p)


import collections
n = int(input())
a = input()
d = collections.Counter(a)
if d['B'] % 2 != 0 and d['W'] % 2 != 0:
	print('-1')
elif d['B'] == 0 or d['W'] == 0:
	print(0)
else:
	ans = list(a)
	ansf = []
	for i in range(0, n - 1):
		if ans[i] == 'B':
			ans[i] = 'W'
			if ans[i + 1] == 'W':
				ans[i + 1] = 'B'
			else:
				ans[i + 1] = 'W'
			ansf.append(i + 1)
	d = collections.Counter(ans)
	if d['B'] == 0:
		print(len(ansf))
		print(*ansf)
	else:
		ans = list(a)
		ansf = []
		for i in range(0, n - 1):
			if ans[i] == 'W':
				ans[i] = 'B'
				if ans[i + 1] == 'W':
					ans[i + 1] = 'B'
				else:
					ans[i + 1] = 'W'
				ansf.append(i + 1)
		d = collections.Counter(ans)
		if d['W'] == 0:
			print(len(ansf))
			print(*ansf)


t = int(input())
s = list(input())
l1 = []
l2 = []
B = 0
W = 0
j = 0
p = []
q = []
for i in s:
	l1.append(i)
	l2.append(i)
	if l1[j] == 'W':
		W += 1
	else:
		B += 1
	j += 1
if W == 0 or B == 0:
	print(0)
else:
	for k in range(t - 1):
		if l1[k] != 'B':
			l1[k] = 'B'
			p.append(k + 1)
			if l1[k + 1] == 'B':
				l1[k + 1] = 'W'
			elif l1[k + 1] == 'W':
				l1[k + 1] = 'B'
		if l2[k] != 'W':
			l2[k] = 'W'
			q.append(k + 1)
			if l2[k + 1] == 'W':
				l2[k + 1] = 'B'
			elif l2[k + 1] == 'B':
				l2[k + 1] = 'W'
	if l1[-1] == 'B':
		print(len(p))
		while p:
			print(p[-1])
			p.pop()
	elif l2[-1] == 'W':
		print(len(q))
		while q:
			print(q[-1])
			q.pop()
	else:
		print(-1)


def calculate_p(l):
	p = []
	for i in range(0, len(l), 2):
		if l[i + 1] - l[i] == 1:
			p.append(l[i] + 1)
		else:
			p.extend([j + 1 for j in range(l[i], l[i + 1])])
	return p

def blocks(n, s):
	b = []
	w = []
	for i in range(n):
		if s[i] == 'B':
			b.append(i)
		else:
			w.append(i)
	even_b = len(b) % 2 == 0
	even_w = len(w) % 2 == 0
	if not even_w and (not b) or (not even_b and (not w)):
		return []
	if not even_w and (not even_b):
		return -1
	return calculate_p(b) if even_b else calculate_p(w)

def test():
	assert blocks(8, 'BWWWWWWB') == [1, 2, 3, 4, 5, 6, 7]
	assert blocks(4, 'BWBB') == -1
	assert blocks(5, 'WWWWW') == []
	assert blocks(3, 'BWB') == [1, 2]
	assert blocks(7, 'WWBBBWW') == [1, 6]
n = int(input())
s = input()
res = blocks(n, s)
if res == -1:
	print(-1)
else:
	print(len(res))
	if len(res) > 0:
		print(' '.join(map(str, res)))


n = int(input())
a = list(input())
k = 0
result = []
for i in range(n - 1):
	if a[i] == 'W':
		k += 1
		result.append(i + 1)
		a[i] = 'B'
		if a[i + 1] == 'W':
			a[i + 1] = 'B'
		else:
			a[i + 1] = 'W'
if a[n - 1] == 'B':
	print(k)
	print(*result)
elif (n - 1) % 2 == 0:
	print(k + (n - 1) // 2)
	for i in range(1, n - 1, 2):
		result.append(i)
	print(*result)
else:
	print(-1)


n = int(input())
aa = input()
a = [i for i in aa]
b = 0
w = 0
for i in a:
	if i == 'W':
		w += 1
	else:
		b += 1
if w == 0 or b == 0:
	print(0)
else:
	ans = []
	for i in range(n - 1):
		if a[i] == 'B':
			ans.append(i + 1)
			a[i] = 'W'
			if a[i + 1] == 'B':
				a[i + 1] = 'W'
			else:
				a[i + 1] = 'B'
	b = 0
	w = 0
	for i in a:
		if i == 'W':
			w += 1
		else:
			b += 1
	ok = False
	if b == 0:
		ok = True
		print(len(ans))
		print(' '.join(map(str, ans)))
	if ok == False:
		a = [i for i in aa]
		ans = []
		for i in range(n - 1):
			if a[i] == 'W':
				ans.append(i + 1)
				a[i] = 'B'
				if a[i + 1] == 'B':
					a[i + 1] = 'W'
				else:
					a[i + 1] = 'B'
		b = 0
		w = 0
		for i in a:
			if i == 'W':
				w += 1
			else:
				b += 1
		if w == 0:
			ok = True
			print(len(ans))
			print(' '.join(map(str, ans)))
		if ok == False:
			print(-1)


def white(arr1):
	arr = arr1.copy()
	ans = []
	for i in range(1, len(arr)):
		if arr[i - 1] == 0:
			arr[i - 1] ^= 1
			arr[i] ^= 1
			ans.append(i)
	if arr[-1] == 1:
		return ans
	else:
		return 0

def black(arr1):
	arr = arr1.copy()
	ans = []
	for i in range(1, len(arr)):
		if arr[i - 1] == 1:
			arr[i - 1] ^= 1
			arr[i] ^= 1
			ans.append(i)
	if arr[-1] == 0:
		return ans
	else:
		return 0
n = int(input())
arr = [1 if i == 'W' else 0 for i in input()]
if white(arr) != 0:
	print(len(white(arr)))
	print(' '.join([str(i) for i in white(arr)]))
elif black(arr) != 0:
	print(len(black(arr)))
	print(' '.join([str(i) for i in black(arr)]))
else:
	print(-1)


n = int(input())
s = input()
l = []
i = 0
s = list(s)
x = s.copy()
tag = True
while i < len(s):
	if i == len(s) - 1:
		if s[i] == 'W':
			tag = False
			break
		else:
			break
	elif s[i] == 'W':
		l.append(i + 1)
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		s[i] = 'B'
		i = i + 1
	else:
		i += 1
if tag:
	print(len(l))
	print(*l)
else:
	i = 0
	tag = True
	l = []
	while i < len(s):
		if i == len(s) - 1:
			if x[i] == 'W':
				tag = False
				break
			else:
				break
		elif x[i] == 'B':
			l.append(i + 1)
			if x[i + 1] == 'B':
				x[i + 1] = 'W'
			else:
				x[i + 1] = 'B'
			x[i] = 'W'
			i = i + 1
		else:
			i += 1
	if tag:
		print(-1)
	else:
		print(len(l))
		print(*l)


def solve(n, ar):
	track = []
	cnt = 0
	s = ar[:]
	for i in range(n - 1):
		if s[i] == 'W':
			continue
		else:
			s[i] = 'W'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			cnt += 1
			track.append(i + 1)
	if s[n - 1] == 'W':
		print(cnt)
		print(' '.join(map(str, track)))
		return
	s = ar[:]
	track = []
	cnt = 0
	for i in range(n - 1):
		if s[i] == 'B':
			continue
		else:
			s[i] = 'B'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			cnt += 1
			track.append(i + 1)
	if s[n - 1] == 'B':
		print(cnt)
		print(' '.join(map(str, track)))
		return
	else:
		print(-1)
	return
n = int(input())
s = list(input())
solve(n, s)


n = int(input())
s = input()
c1 = s.count('W')

def swap(s):
	if s == 'W':
		return 'B'
	else:
		return 'W'
if 'W' not in s or 'B' not in s:
	print(0)
elif (n - c1) % 2 and c1 % 2:
	print(-1)
else:
	L = list(s)
	sol = []
	for i in range(1, n - 1):
		if L[i] != L[i - 1]:
			(L[i], L[i + 1]) = (swap(L[i]), swap(L[i + 1]))
			sol.append(i + 1)
	if L[n - 1] != L[n - 2]:
		for i in range(1, n, 2):
			sol.append(i)
	print(len(sol))
	for i in sol:
		print(i, end=' ')


from typing import List

def solve_for(c: bool, blocks: List[bool]):
	flipped = []
	for i in range(len(blocks) - 1):
		if blocks[i] != c:
			blocks[i] = not blocks[i]
			blocks[i + 1] = not blocks[i + 1]
			flipped.append(i)
	if blocks[-1] == c:
		return flipped
	else:
		return None

def main():
	n: int = int(input())
	blocks: List[bool] = [c == 'B' for c in input()]
	for c in [True, False]:
		res = solve_for(c, blocks.copy())
		if res is not None:
			print(len(res))
			print(' '.join((str(x + 1) for x in res)))
			break
	else:
		print('-1')
main()


from typing import List

def make_equal_to(x: bool, blocks):
	flips = []
	for i in range(len(blocks) - 1):
		if blocks[i] != x:
			blocks[i] = not blocks[i]
			blocks[i + 1] = not blocks[i + 1]
			flips.append(i + 1)
	if blocks[-1] != x:
		return None
	else:
		return flips

def main():
	n = int(input())
	blocks = input()
	blocks: List[bool] = [x == 'B' for x in blocks]
	for k in [True, False]:
		flips = make_equal_to(k, blocks.copy())
		if flips is not None:
			print(len(flips))
			print(' '.join((str(x) for x in flips)))
			return
	print(-1)
main()


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	n = ri()
	S = list(input())
	S2 = list(S)
	target = S[0]
	moves = []
	swap = {'W': 'B', 'B': 'W'}
	for i in range(1, len(S) - 1):
		if S[i] != target:
			moves.append(i + 1)
			S[i + 1] = swap[S[i + 1]]
	S2[0] = swap[S2[0]]
	S2[1] = swap[S2[1]]
	target = S2[0]
	moves2 = [1]
	for i in range(1, len(S2) - 1):
		if S2[i] != target:
			moves2.append(i + 1)
			S2[i + 1] = swap[S2[i + 1]]
	if S[-1] != S[0] and S2[-1] != S2[0]:
		print(-1)
	elif S[-1] == S[0]:
		print(len(moves))
		print(*moves)
	else:
		print(len(moves2))
		print(*moves2)
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
n = oint()
s = list(input())
bc = s.count('B')
wc = s.count('W')
if bc % 2 and wc % 2:
	print(-1)
	exit()
s0 = s[0]
cnt = 0
ans = []
for i in range(1, n - 1):
	if s0 != s[i]:
		s[i] = s0
		if s[i + 1] == 'B':
			s[i + 1] = 'W'
		else:
			s[i + 1] = 'B'
		cnt += 1
		ans.append(i + 1)
if s[-1] != s0:
	for i in range(n // 2):
		cnt += 1
		ans.append(i * 2 + 1)
print(cnt)
print(*ans)


n = int(input())
string = input()
temp = []
for ele in string:
	if ele == 'B':
		temp.append(0)
	else:
		temp.append(1)
string = temp[:]
ans = []
temp = string[:]
for i in range(n - 1):
	if temp[i] == 0:
		temp[i] ^= 1
		temp[i + 1] ^= 1
		ans.append(i + 1)
if temp[n - 1] == 0:
	ans = []
	temp = string[:]
	for i in range(n - 1):
		if temp[i] == 1:
			temp[i] ^= 1
			temp[i + 1] ^= 1
			ans.append(i + 1)
	if temp[n - 1] == 1:
		print(-1)
	else:
		print(len(ans))
		print(*ans)
else:
	print(len(ans))
	print(*ans)


n = int(input())
s = list(input())
cw = 0
cb = 0
l = []
for i in range(n - 1):
	if s[i] == 'B':
		s[i] = 'W'
		s[i + 1] = 'W' if s[i + 1] == 'B' else 'B'
		l.append(i + 1)
if s[n - 1] == 'W':
	print(len(l))
	if len(l) > 0:
		print(*l, sep=' ')
elif n % 2 == 1:
	for i in range(0, n - 1, 2):
		l.append(i + 1)
	print(len(l))
	if len(l) > 0:
		print(*l, sep=' ')
else:
	print(-1)


import sys
input = sys.stdin.readline
N = int(input())
S = [1 if a == 'W' else 0 for a in list(input().rstrip())]
ans = []
for i in range(1, N - 1):
	if S[i - 1] != S[i]:
		S[i] ^= 1
		S[i + 1] ^= 1
		ans.append(i + 1)
if S[N - 2] != S[N - 1] and N % 2 == 0:
	print(-1)
else:
	if S[N - 2] != S[N - 1]:
		for i in range(N - 1):
			if i % 2 == 0:
				ans.append(i + 1)
	print(len(ans))
	for a in ans:
		print(a, end=' ')


def swap(a):
	if a == 'B':
		return 'W'
	return 'B'
n = int(input())
s = list(input())
w = s.count('W')
b = len(s) - w
ans = 0
arr = []
if b % 2 == 0:
	for i in range(len(s) - 1):
		if s[i] == 'B':
			s[i] = swap(s[i])
			s[i + 1] = swap(s[i + 1])
			ans += 1
			arr.append(i)
elif w % 2 == 0:
	for i in range(len(s) - 1):
		if s[i] == 'W':
			s[i] = swap(s[i])
			s[i + 1] = swap(s[i + 1])
			ans += 1
			arr.append(i)
else:
	ans = -1
print(ans)
for i in arr:
	print(i + 1, end=' ')


n = int(input())
sq = input().strip()
sq = list(sq)
(b, w) = (0, 0)
for ch in sq:
	if ch == 'B':
		b += 1
	else:
		w += 1
if b == 0 or w == 0:
	print(0)
	exit(0)
elif b & 1 == 1 and w & 1 == 1:
	print(-1)
	exit(0)
if b & 1 == 0:
	f = 'W'
	s = 'B'
else:
	f = 'B'
	s = 'W'
ans = []
while True:
	no_swap = True
	for i in range(1, n):
		if sq[i - 1] != sq[i] and sq[i - 1] == s:
			sq[i - 1] = f
			sq[i] = s
			ans.append(i - 1)
			no_swap = False
		if sq[i - 1] == sq[i] and sq[i - 1] == s:
			sq[i - 1] = sq[i] = f
			ans.append(i - 1)
	if no_swap:
		s_count = sq.count(s)
		for i in range(n - s_count, n, 2):
			ans.append(i)
		print(len(ans))
		ans = list(map(lambda x: x + 1, ans))
		print(*ans)
		exit(0)


from collections import Counter as C, defaultdict as D, deque as Q
from operator import itemgetter as I
from itertools import product as P, permutations as PERMUT
from bisect import bisect_left as BL, bisect_right as BR, insort as INSORT
from heapq import heappush as HPUSH, heappop as HPOP
from math import floor as MF, ceil as MC, gcd as MG, factorial as F, sqrt as SQRT, inf as INFINITY, log as LOG
from sys import stdin, stdout
INPUT = stdin.readline
PRINT = stdout.write
L = list
M = map

def Player1():
	print('')

def Player2():
	print('')

def Yes():
	PRINT('Yes\n')

def No():
	PRINT('No\n')

def IsPrime(n):
	for i in range(2, MC(SQRT(n)) + 1):
		if n % i == 0:
			return False
	return True

def Factors(x):
	ans = []
	for i in range(1, MC(SQRT(x)) + 1):
		if x % i == 0:
			ans.append(i)
			if x % (x // i) == 0:
				ans.append(x // i)
	return ans

def CheckPath(source, destination, g):
	visited = [0] * 101
	q = Q()
	q.append(source)
	visited[source] = 1
	while q:
		node = q.popleft()
		if node == destination:
			return 1
		for v in g[node]:
			if not visited[v]:
				q.append(v)
				visited[v] = 1
	return 0

def Sieve(n):
	prime = [1] * (n + 1)
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, n + 1, p):
				prime[i] = 0
		p += 1
	primes = []
	for p in range(2, n + 1):
		if prime[p]:
			primes.append(p)
	return primes

def Prefix(a, n):
	p = []
	for i in range(n):
		if i == 0:
			p.append(a[0])
		else:
			p.append(p[-1] + a[i])
	return p

def Suffix(a, n):
	s = [0] * n
	for i in range(n - 1, -1, -1):
		if i == n - 1:
			s[i] = a[i]
		else:
			s[i] = s[i + 1] + a[i]
	return s

def Spf(n):
	spf = [0 for i in range(n)]
	spf[1] = 1
	for i in range(2, n):
		spf[i] = i
	for i in range(4, n, 2):
		spf[i] = 2
	for i in range(3, MC(SQRT(n)) + 1):
		if spf[i] == i:
			for j in range(i * i, n, i):
				if spf[j] == j:
					spf[j] = i
	return spf

def DFS(g, s, visited, ans):
	visited[s] = 1
	for (u, c) in g[s]:
		if visited[u]:
			continue
		if c == ans[s]:
			if c == 1:
				ans[u] = 2
			else:
				ans[u] = 1
		else:
			ans[u] = c
		DFS(g, u, visited, ans)

def lcm(a, b):
	return a * b // MG(a, b)

def Kadane(numbers):
	max_so_far = -INFINITY
	max_ending_here = 0
	max_element = -INFINITY
	for i in range(len(numbers)):
		max_ending_here = max(max_ending_here + numbers[i], 0)
		max_so_far = max(max_ending_here, max_so_far)
		max_element = max(max_element, numbers[i])
	if max_so_far == 0:
		max_so_far = max_element
	return max_so_far

def Main():
	n = int(INPUT())
	x = INPUT()
	a = [0] * n
	for i in range(n):
		if x[i] == 'W':
			a[i] = 1
	nexxt = a[0]
	ans = []
	for i in range(n - 1):
		if nexxt != 1:
			nexxt = a[i + 1] ^ 1
			ans.append(i + 1)
		else:
			nexxt = a[i + 1]
	if nexxt == 1:
		PRINT('%d\n' % len(ans))
		for v in ans:
			PRINT('%d ' % v)
	else:
		nexxt = a[0]
		ans = []
		for i in range(n - 1):
			if nexxt != 0:
				nexxt = a[i + 1] ^ 1
				ans.append(i + 1)
			else:
				nexxt = a[i + 1]
		if nexxt == 0:
			PRINT('%d\n' % len(ans))
			for v in ans:
				PRINT('%d ' % v)
		else:
			PRINT('%d' % -1)
Main()


from fractions import gcd
from heapq import *
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7

def main():
	n = int(input())
	s = list(input())
	(b, w) = (0, 0)
	for i in range(n):
		if s[i] == 'B':
			b += 1
		else:
			w += 1
	if b % 2 == 1 and w % 2 == 1:
		print(-1)
	elif b == 0 or w == 0:
		print(0)
	else:
		ans = 0
		ansl = []
		ss = s
		for i in range(n - 1):
			if ss[i] == 'B':
				ansl.append(i + 1)
				ans += 1
				ss[i] = 'W'
				if ss[i + 1] == 'B':
					ss[i + 1] = 'W'
				else:
					ss[i + 1] = 'B'
		if ss.count('W') != n:
			for i in range(n - 1):
				if ss[i] == 'W':
					ans += 1
					ansl.append(i + 1)
					ss[i] = 'B'
					if ss[i + 1] == 'B':
						ss[i + 1] = 'W'
					else:
						ss[i + 1] = 'B'
		print(ans)
		print(*ansl)
main()


a = int(input())
b = input()
oper = []
operation = 0
blackwhite = [0, 0]
for i in b:
	if i == 'B':
		blackwhite[0] += 1
	else:
		blackwhite[1] += 1
if (a - blackwhite[0]) % 2 == 0:
	glavcvet = 'B'
	zapcvet = 'W'
elif (a - blackwhite[1]) % 2 == 0:
	glavcvet = 'W'
	zapcvet = 'B'
else:
	glavcvet = 'Z'
	print(-1)
if glavcvet != 'Z':
	for (schet, i) in enumerate(b):
		if (i == zapcvet) & (operation == 1) | (i == glavcvet) & (operation == 0):
			operation = 0
		else:
			operation = 1
			oper.append(str(schet + 1))
	print(len(oper))
	print(' '.join(oper))


def turn(blocks, frc, toc):
	res = []
	for i in range(len(blocks) - 1):
		if blocks[i] == frc:
			res.append(i + 1)
			blocks[i] = toc
			if blocks[i + 1] == frc:
				blocks[i + 1] = toc
			else:
				blocks[i + 1] = frc
	print(len(res))
	print(*res)
n = int(input())
blocks = input()
wc = 0
bc = 0
for b in blocks:
	if b == 'W':
		wc += 1
	else:
		bc += 1
if wc % 2 != 0 and bc % 2 != 0:
	print(-1)
elif wc % 2 == 0 and bc % 2 != 0:
	turn(list(blocks), 'W', 'B')
elif wc % 2 != 0 and bc % 2 == 0:
	turn(list(blocks), 'B', 'W')
elif wc <= bc:
	if wc > 0:
		turn(list(blocks), 'W', 'B')
	else:
		print(0)
elif bc > 0:
	turn(list(blocks), 'B', 'W')
else:
	print(0)


n = int(input())
s = list(input())
c = s.copy()
k = []
for i in range(n - 1):
	if s[i] == 'W':
		pass
	else:
		s[i] = 'W'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		k.append(i + 1)
if s == ['W'] * n:
	print(len(k))
	print(*k)
else:
	s = c.copy()
	k = []
	for i in range(n - 1):
		if s[i] == 'B':
			pass
		else:
			s[i] = 'B'
			if s[i + 1] == 'W':
				s[i + 1] = 'B'
			else:
				s[i + 1] = 'W'
			k.append(i + 1)
	if s == ['B'] * n:
		print(len(k))
		print(*k)
	else:
		print(-1)


n = int(input())
s = list(input())
ans = []
if s[0] == 'W':
	ans.append(0)
	s[0] = 'B'
	if s[1] == 'W':
		s[1] = 'B'
	else:
		s[1] = 'W'
for i in range(1, n - 1):
	if s[i] == 'W':
		s[i] = 'B'
		if s[i + 1] == 'W':
			s[i + 1] = 'B'
		else:
			s[i + 1] = 'W'
		ans.append(i)
if s != ['B' for i in range(n)] and n % 2 == 0:
	print(-1)
	exit()
if s != ['B' for i in range(n)]:
	for i in range(n - 1):
		if i % 2 == 0:
			ans.append(i)
print(len(ans))
print(' '.join(map(str, [i + 1 for i in ans])))


def solve():
	n = int(input())
	s = input()
	ans = 0
	res = []
	w = 0
	b = 0
	for i in range(n):
		if s[i] == 'W':
			w += 1
		if s[i] == 'B':
			b += 1
	delta = -1
	if w == 0 or b == 0:
		print(0)
		return
	if w % 2 == 1:
		if b % 2 == 1:
			print(-1)
			return
		else:
			delta = 'B'
	else:
		delta = 'W'
	s = list(s)
	for i in range(n):
		if s[i] == delta:
			s[i] = 0
		else:
			s[i] = 1
	for i in range(n - 1):
		if s[i] == 0:
			if s[i + 1] == 1:
				s[i + 1] = 0
			else:
				s[i + 1] = 1
			ans += 1
			res.append(i + 1)
	print(ans)
	for i in range(len(res)):
		print(res[i], ' ')
solve()


n = int(input())
s = input()
l = [i for i in s]
s = list(l)
numofb = 0
numofw = 0
for i in s:
	if i == 'B':
		numofb += 1
	else:
		numofw += 1
c = 0
if numofb % 2 == 0:
	c = 'W'
elif numofw % 2 == 0:
	c = 'B'
if c == 0:
	print(-1)
else:
	numofs = 0
	l = []
	for i in range(n - 1):
		if s[i] != c:
			if s[i] == 'W':
				s[i] = 'B'
			else:
				s[i] = 'W'
			if s[i + 1] == 'B':
				s[i + 1] = 'W'
			else:
				s[i + 1] = 'B'
			l.append(i)
			numofs += 1
	print(numofs)
	for i in l:
		print(i + 1, end=' ')
	print()


def change(a):
	if a == 'W':
		return 'B'
	else:
		return 'W'
n = int(input())
ss = input()
s = []
s[:0] = ss
ops = []
good = 'w'
if s.count('B') == 0 or s.count('W') == 0:
	print(0)
	exit()
elif s.count('B') % 2 == 0:
	good = 'W'
elif s.count('W') % 2 == 0:
	good = 'B'
else:
	print(-1)
	exit()
for i in range(n - 1):
	if s[i] != good:
		s[i] = change(s[i])
		s[i + 1] = change(s[i + 1])
		ops.append(i + 1)
print(len(ops))
for o in ops:
	print(o, end=' ')
print('')