Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)

children = [0] * N

for j in range(N): # 子供ごと

	if S[j] == 'R':
		pos_next = j + 1
		while S[pos_next] == 'R':
			pos_next += 1

		num_until_turn = pos_next - j

		if num_until_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next-1] += 1

	else:  # 'L'
		pos_next = j - 1
		while S[pos_next] == 'L':
			pos_next -= 1

		num_until_turn = pos_next - j

		if num_until_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next+1] += 1

print(*children)


Fixed submission:
S = input()
N = len(S)

children = [0] * N

turn_position = list()

for i in range(N-1):
	if S[i]=='R' and S[i+1]=='L':
		turn_position.append(i)

for turn_i in range(len(turn_position) - 1):
	turn_pos = turn_position[turn_i]
	turn_pos_next = turn_position[turn_i + 1]

	children[turn_pos] += 1
	children[turn_pos+1] += 1

	for pos_i in range(turn_pos+2, turn_pos_next):
		if S[pos_i] == 'L':
			if (pos_i - turn_pos) % 2 == 0:
				children[turn_pos] += 1
			else:
				children[turn_pos+1] += 1
		else:
			if (turn_pos_next - pos_i) % 2 == 0:
				children[turn_pos_next] += 1
			else:
				children[turn_pos_next+1] += 1

turn_pos_first = turn_position[0]
for pos_i in range(0, turn_pos_first):
	if (turn_pos_first - pos_i) % 2 == 0:
		children[turn_pos_first] += 1
	else:
		children[turn_pos_first+1] += 1

turn_pos_last = turn_position[-1]
children[turn_pos_last] += 1
children[turn_pos_last+1] += 1
for pos_i in range(turn_pos_last+2, N):
	if (pos_i - turn_pos_last) % 2 == 0:
		children[turn_pos_last] += 1
	else:
		children[turn_pos_last+1] += 1

print(*children)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)

children = [0] * N

num_turn = 10**100

for j in range(N): # 子供ごと

	if S[j] == 'R':
		pos_next = j + 1
		while S[pos_next] == 'R':
			pos_next += 1

		num_until_turn = pos_next - j
		num_after_turn = num_turn - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next-1] += 1

	else:  # 'L'
		pos_next = j - 1
		while S[pos_next] == 'L':
			pos_next -= 1

		num_until_turn = pos_next - j
		num_after_turn = num_turn - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next+1] += 1

print(*children)


Fixed submission:
S = input()
N = len(S)

children = [0] * N

turn_position = list()

for i in range(N-1):
	if S[i]=='R' and S[i+1]=='L':
		turn_position.append(i)

for turn_i in range(len(turn_position) - 1):
	turn_pos = turn_position[turn_i]
	turn_pos_next = turn_position[turn_i + 1]

	children[turn_pos] += 1
	children[turn_pos+1] += 1

	for pos_i in range(turn_pos+2, turn_pos_next):
		if S[pos_i] == 'L':
			if (pos_i - turn_pos) % 2 == 0:
				children[turn_pos] += 1
			else:
				children[turn_pos+1] += 1
		else:
			if (turn_pos_next - pos_i) % 2 == 0:
				children[turn_pos_next] += 1
			else:
				children[turn_pos_next+1] += 1

turn_pos_first = turn_position[0]
for pos_i in range(0, turn_pos_first):
	if (turn_pos_first - pos_i) % 2 == 0:
		children[turn_pos_first] += 1
	else:
		children[turn_pos_first+1] += 1

turn_pos_last = turn_position[-1]
children[turn_pos_last] += 1
children[turn_pos_last+1] += 1
for pos_i in range(turn_pos_last+2, N):
	if (pos_i - turn_pos_last) % 2 == 0:
		children[turn_pos_last] += 1
	else:
		children[turn_pos_last+1] += 1

print(*children)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)

children = [0] * N

for j in range(N): # 子供ごと

	if S[j] == 'R':
		pos_next = j + 1
		while S[pos_next] == 'R':
			pos_next += 1

		num_until_turn = pos_next - j
		num_after_turn = 10**100 - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next-1] += 1

	else:  # 'L'
		pos_next = j - 1
		while S[pos_next] == 'L':
			pos_next -= 1

		num_until_turn = pos_next - j
		num_after_turn = 10**100 - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next+1] += 1

print(*children)


Fixed submission:
S = input()
N = len(S)

children = [0] * N

turn_position = list()

for i in range(N-1):
	if S[i]=='R' and S[i+1]=='L':
		turn_position.append(i)

for turn_i in range(len(turn_position) - 1):
	turn_pos = turn_position[turn_i]
	turn_pos_next = turn_position[turn_i + 1]

	children[turn_pos] += 1
	children[turn_pos+1] += 1

	for pos_i in range(turn_pos+2, turn_pos_next):
		if S[pos_i] == 'L':
			if (pos_i - turn_pos) % 2 == 0:
				children[turn_pos] += 1
			else:
				children[turn_pos+1] += 1
		else:
			if (turn_pos_next - pos_i) % 2 == 0:
				children[turn_pos_next] += 1
			else:
				children[turn_pos_next+1] += 1

turn_pos_first = turn_position[0]
for pos_i in range(0, turn_pos_first):
	if (turn_pos_first - pos_i) % 2 == 0:
		children[turn_pos_first] += 1
	else:
		children[turn_pos_first+1] += 1

turn_pos_last = turn_position[-1]
children[turn_pos_last] += 1
children[turn_pos_last+1] += 1
for pos_i in range(turn_pos_last+2, N):
	if (pos_i - turn_pos_last) % 2 == 0:
		children[turn_pos_last] += 1
	else:
		children[turn_pos_last+1] += 1

print(*children)