There are $n + 1$ cities, numbered from $0$ to $n$. $n$ roads connect these cities, the $i$-th road connects cities $i - 1$ and $i$ ($i \in [1, n]$).

Each road has a direction. The directions are given by a string of $n$ characters such that each character is either L or R. If the $i$-th character is L, it means that the $i$-th road initially goes from the city $i$ to the city $i - 1$; otherwise it goes from the city $i - 1$ to the city $i$.

A traveler would like to visit as many cities of this country as possible. Initially, they will choose some city to start their journey from. Each day, the traveler must go from the city where they currently are to a neighboring city using one of the roads, and they can go along a road only if it is directed in the same direction they are going; i. e., if a road is directed from city $i$ to the city $i + 1$, it is possible to travel from $i$ to $i + 1$, but not from $i + 1$ to $i$. After the traveler moves to a neighboring city, all roads change their directions to the opposite ones. If the traveler cannot go from their current city to a neighboring city, their journey ends; it is also possible to end the journey whenever the traveler wants to.

The goal of the traveler is to visit as many different cities as possible (they can visit a city multiple times, but only the first visit is counted). For each city $i$, calculate the maximum number of different cities the traveler can visit during exactly one journey if they start in the city $i$.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

Each test case consists of two lines. The first line contains one integer $n$ ($1 \le n \le 3 \cdot 10^5$). The second line contains the string $s$ consisting of exactly $n$ characters, each character is either L or R.

It is guaranteed that the sum of $n$ over all test cases does not exceed $3 \cdot 10^5$.


-----Output-----

For each test case, print $n + 1$ integers. The $i$-th integer should be equal to the maximum number of different cities the traveler can visit during one journey if this journey starts in the $i$-th city.


-----Examples-----

Input
2
6
LRRRLL
3
LRL
Output
1 3 2 3 1 3 2
1 4 1 4


-----Note-----

None

Difficulty: MEDIUM_HARD

Solutions:
from sys import stdin, stdout
import math
from functools import reduce

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		arr = stdin.readline().strip()
		dp_l = [0 for _ in range(n)]
		prev = 'R'
		cnt = 0
		for (i, x) in enumerate(arr):
			if prev == 'R' and x == 'L':
				cnt += 1
			elif prev == 'L' and x == 'R':
				cnt += 1
			else:
				cnt = 1
			prev = x
			dp_l[i] = cnt
		dp_r = [0 for _ in range(n)]
		prev = 'L'
		cnt = 0
		for i in range(n - 1, -1, -1):
			x = arr[i]
			if prev == 'R' and x == 'L':
				cnt += 1
			elif prev == 'L' and x == 'R':
				cnt += 1
			else:
				cnt = 1
			prev = x
			dp_r[i] = cnt
		ans = []
		for i in range(n + 1):
			sm = 1
			if i > 0:
				if arr[i - 1] == 'L':
					sm += dp_l[i - 1]
			if i < n:
				if arr[i] == 'R':
					sm += dp_r[i]
			ans.append(str(sm))
		stdout.write(' '.join(ans) + '\n')
main()


from sys import stdin, exit
from bisect import bisect_left as bl, bisect_right as br
from itertools import accumulate
input = lambda : stdin.readline()[:-1]
intput = lambda : int(input())
sinput = lambda : input().split()
intsput = lambda : map(int, sinput())

def dprint(*args, **kwargs):
	if debugging:
		print(*args, **kwargs)
debugging = 1
t = intput()
for _ in range(t):
	n = intput()
	s = input()
	switches = [0]
	for i in range(1, len(s)):
		prev = s[i - 1]
		curr = s[i]
		if prev == curr:
			switches.append(i)
	switches.append(n)
	ans = []
	for i in range(n + 1):
		cnt = 1
		if i < n:
			if s[i] == 'R':
				cut = switches[br(switches, i)]
				cnt += cut - i
		if i > 0:
			if s[i - 1] == 'L':
				cut = switches[bl(switches, i) - 1]
				cnt += i - cut
		ans.append(cnt)
	print(' '.join(map(str, ans)))


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
from fractions import Fraction
sys.setrecursionlimit(100000)
INF = float('inf')
mod = 998244353
for t in range(int(data())):
	n = int(data())
	s = data()
	forw = [1] * (n + 1)
	back = [1] * (n + 1)
	for i in range(1, n):
		if s[i - 1] != s[i]:
			forw[i + 1] = forw[i] + 1
		else:
			forw[i + 1] = 1
		if s[n - i] != s[n - 1 - i]:
			back[n - i - 1] = back[n - i] + 1
		else:
			back[n - i - 1] = 1
	ans = [1] * (n + 1)
	for i in range(n):
		if s[i] == 'R':
			ans[i] += back[i]
		else:
			ans[i + 1] += forw[i + 1]
	outl(ans)


from __future__ import division, print_function
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil, sqrt, log2
from copy import deepcopy
from collections import deque
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

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 testcase(t):
	for pp in range(t):
		solve(pp)

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

def power(x, y, p):
	y %= p - 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

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
inf = pow(10, 20)
mod = 10 ** 9 + 7

def solve(case):
	n = int(inp())
	a = ['0'] + list(inp())
	right = [0] * (n + 3)
	for i in range(n - 1, -1, -1):
		if (n - i) % 2 == 0:
			if a[i + 1] + a[i + 2] == 'RL':
				right[i] = right[i + 2] + 2
			else:
				right[i] = 1 if a[i + 1] == 'R' else 0
		elif i + 2 <= n and a[i + 1] + a[i + 2] == 'RL':
			right[i] = right[i + 2] + 2
		else:
			right[i] = 1 if a[i + 1] == 'R' else 0
	left = [0] * (n + 3)
	for i in range(1, n + 1):
		if a[i - 1] + a[i] == 'RL':
			left[i] = left[i - 2] + 2
		else:
			left[i] = 1 if a[i] == 'L' else 0
	ans = [right[i] + left[i] for i in range(n + 1)]
	print(' '.join((str(i + 1) for i in ans)))
testcase(int(inp()))


def readInt():
	return int(input())

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

def readString():
	return input().rstrip()

def readCase():
	return readString()

def find_end(p, directions):
	target = 'R'
	while p < len(directions):
		if directions[p] == target:
			p += 1
			if target == 'R':
				target = 'L'
			else:
				target = 'R'
		else:
			return p
	return p

def solve(n, directions):
	results = [0 for _ in range(n)]
	p = 0
	while p < n:
		reachable = 1
		if p != 0 and directions[p - 1] == 'L':
			reachable += 1
		new_p = find_end(p, directions)
		reachable += new_p - p
		for t in range(p, new_p + 1):
			if (t - p) % 2 == 0:
				results[t] = reachable
			else:
				results[t] = 1
		if new_p < n - 1 and directions[new_p] == 'R':
			p = new_p
		else:
			p = new_p + 1
	return ' '.join((str(x) for x in results))
cases = readInt()
for case in range(cases):
	n = readInt()
	directions = list(readString())
	print(solve(n + 1, directions))


import sys
input = lambda : sys.stdin.readline().rstrip()

def f(st):
	if st == 'L':
		return 0
	return 1
for _ in range(int(input())):
	n = int(input())
	S = list(map(f, input()))
	(L, R) = (list(range(n + 1)), list(range(n + 1)))
	(rL, rR) = (list(range(n + 1)), list(range(n + 1)))
	for i in range(n):
		if not S[i]:
			L[i + 1] = rL[i]
		if S[i]:
			rL[i + 1] = L[i]
		if S[n - 1 - i]:
			R[-2 - i] = rR[-1 - i]
		if not S[n - 1 - i]:
			rR[-2 - i] = R[-1 - i]
	Ans = [R[i] - L[i] + 1 for i in range(n + 1)]
	print(*Ans, sep=' ')


for testcase in range(int(input())):
	n = int(input())
	s = input()
	trav1 = []
	trav2 = []
	tick = False
	for i in s:
		tick = not tick
		if (i == 'L') ^ tick:
			trav1.append(1)
			trav2.append(0)
		else:
			trav1.append(0)
			trav2.append(1)
	dp1a = [0]
	dp1b = [0]
	inarow = 0
	for i in trav1:
		inarow = (inarow + 1) * i
		dp1a.append(inarow)
	trav1.reverse()
	inarow = 0
	for i in trav1:
		inarow = (inarow + 1) * i
		dp1b.append(inarow)
	dp1b.reverse()
	dp2a = [0]
	dp2b = [0]
	for i in trav2:
		inarow = (inarow + 1) * i
		dp2a.append(inarow)
	trav2.reverse()
	inarow = 0
	for i in trav2:
		inarow = (inarow + 1) * i
		dp2b.append(inarow)
	dp2b.reverse()
	ans = []
	for i in range(n + 1):
		if i % 2:
			ans.append(dp2a[i] + dp2b[i] + 1)
		else:
			ans.append(dp1a[i] + dp1b[i] + 1)
	print(' '.join(map(str, ans)))


for _ in range(int(input())):
	n = int(input())
	s = input()
	i = 0
	prev = s[0]
	keylist = []
	flag = False
	while i < n:
		if s[i] != prev:
			flag = True
			keylist.append(i - 1)
		while s[i] != prev:
			prev = s[i]
			i += 1
			if i >= n:
				break
		if i >= n:
			keylist.append(n)
			break
		if flag:
			keylist.append(i)
		flag = False
		i += 1
	ans = [1] * (n + 1)
	for i in range(len(keylist) // 2):
		x = keylist[2 * i]
		y = keylist[2 * i + 1]
		if s[x] == 'L':
			for j in range(x + 1, y + 1, 2):
				ans[j] = y - x + 1
		else:
			for j in range(x, y + 1, 2):
				ans[j] = y - x + 1
	for i in range(n):
		if s[i] == 'L' and ans[i + 1] == 1:
			ans[i + 1] = 2
		if s[i] == 'R' and ans[i] == 1:
			ans[i] = 2
	print(*ans)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	roads = list(input())
	ans = []
	lefts = [0 for i in range(n + 1)]
	rights = [0 for i in range(n + 1)]
	if roads[0] == 'L':
		lefts[1] = 1
	if roads[n - 1] == 'R':
		rights[n - 1] = 1
	for i in range(2, n + 1):
		if roads[i - 1] == 'L':
			if roads[i - 2] == 'L':
				lefts[i] = 1
			else:
				lefts[i] = lefts[i - 2] + 2
	for i in range(n - 2, -1, -1):
		if roads[i] == 'R':
			if roads[i + 1] == 'R':
				rights[i] = 1
			else:
				rights[i] = rights[i + 2] + 2
	for i in range(n + 1):
		ans.append(str(lefts[i] + rights[i] + 1))
	print(' '.join(ans))


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
int1 = lambda x: int(x) - 1

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

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

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

def solve():
	for _ in range(int(input())):
		(n,) = aj()
		s = input()
		dp = [[0] * 2 for i in range(n)]
		if s[-1] == 'L':
			dp[-1][0] = 1
		else:
			dp[-1][1] = 1
		for i in range(n - 2, -1, -1):
			if s[i] == 'L':
				dp[i][0] = 1 + dp[i + 1][1]
				dp[i][1] = 0
			else:
				dp[i][0] = 0
				dp[i][1] = 1 + dp[i + 1][0]
		dp2 = [[0] * 2 for i in range(n)]
		if s[0] == 'L':
			dp2[0][0] = 1
		else:
			dp2[0][1] = 1
		for i in range(1, n):
			if s[i] == 'L':
				dp2[i][0] = 1 + dp2[i - 1][1]
				dp2[i][1] = 0
			else:
				dp2[i][0] = 0
				dp2[i][1] = 1 + dp2[i - 1][0]
		ans = [1] * (n + 1)
		ans[0] += dp[0][1]
		ans[-1] += dp2[-1][0]
		for i in range(1, n):
			ans[i] += dp2[i - 1][0]
			ans[i] += dp[i][1]
		print(*ans)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


class UnionFind:

	def __init__(self, n):
		self.parent = list(range(n))

	def find(self, a):
		acopy = a
		while a != self.parent[a]:
			a = self.parent[a]
		while acopy != a:
			(self.parent[acopy], acopy) = (a, self.parent[acopy])
		return a

	def union(self, a, b):
		self.parent[self.find(b)] = self.find(a)

def main():
	t = int(input())
	allAns = []
	for _ in range(t):
		n = int(input())
		odd = input()
		e = []
		for c in odd:
			if c == 'L':
				e.append('R')
			else:
				e.append('L')
		even = ''.join(e)
		nCities = n + 1
		visitedCity = [False for __ in range(nCities * 2)]
		uf = UnionFind(nCities * 2)
		for city in range(nCities):
			if visitedCity[city]:
				continue
			stack = [city]
			visitedCity[city] = True
			while stack:
				c = stack.pop()
				if 0 <= c < nCities - 1 and odd[c] == 'R' and (not visitedCity[c + 1 + nCities]):
					visitedCity[c + 1 + nCities] = True
					uf.union(c, c + 1 + nCities)
					stack.append(c + 1 + nCities)
				if 1 <= c < nCities and odd[c - 1] == 'L' and (not visitedCity[c - 1 + nCities]):
					visitedCity[c - 1 + nCities] = True
					uf.union(c, c - 1 + nCities)
					stack.append(c - 1 + nCities)
				if nCities <= c < 2 * nCities - 1 and even[c - nCities] == 'R' and (not visitedCity[c + 1 - nCities]):
					visitedCity[c + 1 - nCities] = True
					uf.union(c, c + 1 - nCities)
					stack.append(c + 1 - nCities)
				if nCities + 1 <= c < nCities and even[c - nCities - 1] == 'L' and (not visitedCity[c - 1 - nCities]):
					visitedCity[c - 1 - nCities] = True
					uf.union(c, c - 1 - nCities)
					stack.append(c - 1 - nCities)
		parentCityGroupCnts = [0 for _ in range(nCities * 2)]
		for i in range(nCities * 2):
			parentCityGroupCnts[uf.find(i)] += 1
		ans = [-1 for _ in range(nCities)]
		for i in range(nCities):
			ans[i] = parentCityGroupCnts[uf.find(i)]
		allAns.append(ans)
	multiLineArrayOfArraysPrint(allAns)
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]
inf = float('inf')
MOD = 10 ** 9 + 7
main()


a = int(input())
for i in range(a):
	s = int(input())
	s = input()
	ans = []
	for i in range(len(s)):
		if s[i] == 'L':
			ans.append(1)
		else:
			ans.append(0)
	bac = []
	for i in range(len(ans)):
		if ans[i] == 0:
			bac.append(0)
			continue
		if i == 0 and ans[i] == 1:
			bac.append(1)
			continue
		if ans[i] == 1:
			if i >= 2:
				if bac[-1] == 0:
					bac.append(bac[-2] + 2)
				else:
					bac.append(1)
			elif ans[0] == 0:
				bac.append(2)
			else:
				bac.append(1)
	forw = [0 for i in range(len(ans))]
	for i in range(len(ans) - 2, -1, -1):
		if ans[i + 1] == 1:
			forw[i] = 0
			continue
		elif i + 2 <= len(ans) - 1 and ans[i + 2] == 1:
			forw[i] = forw[i + 2] + 2
		elif i + 2 <= len(ans) - 1 and ans[i + 2] == 0:
			forw[i] = 1
		elif i + 1 <= len(ans) - 1:
			if ans[i + 1] == 0:
				forw[i] = 1
			else:
				forw[i] = 0
	fin = [0 for i in range(len(forw) + 1)]
	for i in range(len(bac)):
		fin[i + 1] = bac[i] + forw[i] + 1
	cnt = 0
	for i in range(len(s)):
		if i % 2 == 0:
			if s[i] == 'R':
				cnt += 1
			else:
				break
		elif s[i] == 'L':
			cnt += 1
		else:
			break
	fin[0] = cnt + 1
	print(*fin)


import collections
import string
import math
import copy
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))

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

def exgcd(a, b):
	if not b:
		return (1, 0)
	(y, x) = exgcd(b, a % b)
	y -= a // b * x
	return (x, y)

def getinv(a, m):
	(x, y) = exgcd(a, m)
	return --1 if x == 1 else x % m

def comb(n, b):
	res = 1
	b = min(b, n - b)
	for i in range(b):
		res = res * (n - i) * getinv(i + 1, mo) % mo
	return res % mo

def quickpower(a, n):
	res = 1
	while n:
		if n & 1:
			res = res * a % mo
		n >>= 1
		a = a * a % mo
	return res

def dis(a, b):
	return abs(a[0] - b[0]) + abs(a[1] - b[1])

def getpref(x):
	if x > 1:
		return x * (x - 1) >> 1
	else:
		return 0

def orafli(upp):
	primes = []
	marked = [False for i in range(upp + 3)]
	for i in range(2, upp):
		if not marked[i]:
			primes.append(i)
		for j in primes:
			if i * j >= upp:
				break
			marked[i * j] = True
			if i % j == 0:
				break
	return primes
t = int(input())
for ti in range(t):
	n = int(input())
	fa = [i for i in range(n + 1)]
	ans = [1 for i in range(n + 1)]
	s = input()
	p = 0
	carry = 0
	for i in range(n >> 1):
		ofs = i << 1
		if s[ofs:ofs + 2] == 'RL':
			fa[ofs + 2] = p
			ans[p] += 2
		elif s[ofs:ofs + 2] == 'RR':
			ans[p] += 1 + carry
			carry = 0
			p = ofs + 2
		elif s[ofs:ofs + 2] == 'LL':
			ans[p] += carry
			carry = 1
			p = ofs + 2
		elif s[ofs:ofs + 2] == 'LR':
			ans[p] += carry
			carry = 0
			p = ofs + 2
	if n & 1:
		if s[-1] == 'R':
			ans[fa[-2]] += 1
		ans[fa[-2]] += carry
	else:
		ans[fa[-1]] += carry
	p = 1
	carry = 0
	for i in range(n >> 1):
		ofs = (i << 1) + 1
		if s[ofs:ofs + 2] == 'RL':
			fa[ofs + 2] = p
			ans[p] += 2
		elif s[ofs:ofs + 2] == 'RR':
			ans[p] += 1 + carry
			carry = 0
			p = ofs + 2
		elif s[ofs:ofs + 2] == 'LL':
			ans[p] += carry
			carry = 1
			p = ofs + 2
		elif s[ofs:ofs + 2] == 'LR':
			ans[p] += carry
			carry = 0
			p = ofs + 2
	if s[0] == 'L':
		ans[fa[1]] += 1
	if n & 1 == 0:
		if s[-1] == 'R':
			ans[fa[-2]] += 1
		ans[fa[-2]] += carry
	else:
		ans[fa[-1]] += carry
	for (idx, i) in enumerate(fa):
		print(f'{ans[i]}' + ' \n'[idx == n], end='')


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()[:-1]
	pre1 = [0]
	if s[0] == 'L':
		start = 'R'
	else:
		start = 'L'
	c = 0
	for i in s:
		if i != start:
			c += 1
			pre1.append(c)
		else:
			c = 1
			pre1.append(c)
		start = i
	pre2 = [0]
	s = s[::-1]
	if s[0] == 'L':
		start = 'R'
	else:
		start = 'L'
	c = 0
	for i in s:
		if i != start:
			c += 1
			pre2.append(c)
		else:
			c = 1
			pre2.append(c)
		start = i
	pre2 = pre2[::-1]
	vals = []
	s = s[::-1]
	for i in range(n + 1):
		if i == 0:
			if s[i] == 'L':
				vals.append(1)
			else:
				vals.append(pre2[i] + 1)
		elif i == n:
			if s[i - 1] == 'R':
				vals.append(1)
			else:
				vals.append(pre1[i] + 1)
		elif s[i - 1] == 'R' and s[i] == 'L':
			vals.append(1)
		elif s[i - 1] == 'R' and s[i] == 'R':
			vals.append(pre2[i] + 1)
		elif s[i - 1] == 'L' and s[i] == 'L':
			vals.append(pre1[i] + 1)
		else:
			vals.append(pre1[i] + pre2[i] + 1)
	print(*vals)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	S = input().strip()
	A = []
	for i in range(n):
		if i % 2 == 0:
			if S[i] == 'L':
				A.append(0)
			else:
				A.append(1)
		elif S[i] == 'L':
			A.append(1)
		else:
			A.append(0)
	LEFT = [1]
	RIGHT = [1]
	for i in range(1, n):
		if A[i] == A[i - 1]:
			LEFT.append(LEFT[-1] + 1)
		else:
			LEFT.append(1)
	for i in range(n - 2, -1, -1):
		if A[i] == A[i + 1]:
			RIGHT.append(RIGHT[-1] + 1)
		else:
			RIGHT.append(1)
	RIGHT.reverse()
	ANSL = []
	for i in range(n + 1):
		ANS = 0
		if i % 2 == 0:
			if i != 0 and A[i - 1] == 1:
				ANS += LEFT[i - 1]
			if i != n and A[i] == 1:
				ANS += RIGHT[i]
		else:
			if i != 0 and A[i - 1] == 0:
				ANS += LEFT[i - 1]
			if i != n and A[i] == 0:
				ANS += RIGHT[i]
		ANSL.append(ANS + 1)
	print(*ANSL)


tc = int(input())
for t in range(tc):
	n = int(input())
	s = input()
	dpl = [i for i in range(n + 1)]
	dpr = [i for i in range(n + 1)]
	for i in range(n + 1):
		if i == 0 or s[i - 1] == 'R':
			dpl[i] = i
		elif i == 1 or s[i - 2] == 'L':
			dpl[i] = i - 1
		else:
			dpl[i] = dpl[i - 2]
	for i in range(n, -1, -1):
		if i == n or s[i] == 'L':
			dpr[i] = i
		elif i == n - 1 or s[i + 1] == 'R':
			dpr[i] = i + 1
		else:
			dpr[i] = dpr[i + 2]
	ans = [dpr[i] - dpl[i] + 1 for i in range(n + 1)]
	print(*ans)


import sys
import math

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

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

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

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

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod
for _ in range(II()):
	n = II()
	s = list(SI())
	dp = [1 for i in range(n + 1)]
	count = 0
	for i in range(n):
		if i == 0:
			if s[i] == 'L':
				dp[i + 1] += 1
			count = 1
		elif i != 0:
			if s[i] != s[i - 1]:
				count += 1
			else:
				count = 1
			if s[i] == 'L':
				dp[i + 1] += count
	count = 0
	for i in range(n - 1, -1, -1):
		if i == n - 1:
			if s[i] == 'R':
				dp[i] += 1
			count = 1
		elif i != n - 1:
			if s[i] != s[i + 1]:
				count += 1
			else:
				count = 1
			if s[i] == 'R':
				dp[i] += count
	print(*dp)


import sys
input = sys.stdin.readline
import math
t = int(input())
for f in range(t):
	n = int(input())
	s = input().rstrip()
	change = [1] * (n + 1)
	i = 0
	while i < n:
		if s[i] == 'L':
			memo = i
			while True:
				if i >= n - 1:
					break
				elif s[i + 1] == s[i]:
					break
				i += 1
			a = i - memo + 1
			for j in range(memo + 1, i + 2, 2):
				change[j] += a
			i += 1
		elif s[i] == 'R':
			memo = i
			while True:
				if i >= n - 1:
					break
				elif s[i + 1] == s[i]:
					break
				i += 1
			a = i - memo + 1
			for j in range(memo, i + 2, 2):
				change[j] += a
			i += 1
	print(*change)


import math

def solve(n, s):
	dpl = [i for i in range(n + 1)]
	dpr = [i for i in range(n + 1)]
	for i in range(n + 1):
		if i == 0 or s[i - 1] == 'R':
			dpl[i] = i
		elif i == 1 or s[i - 2] == 'L':
			dpl[i] = i - 1
		else:
			dpl[i] = dpl[i - 2]
	for i in range(n, -1, -1):
		if i == n or s[i] == 'L':
			dpr[i] = i
		elif i == n - 1 or s[i + 1] == 'R':
			dpr[i] = i + 1
		else:
			dpr[i] = dpr[i + 2]
	ans = [dpr[i] - dpl[i] + 1 for i in range(n + 1)]
	print(*ans)
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	solve(n, s)


for _ in range(int(input())):
	(n, s) = (int(input()), input())
	(dpl, dpr) = ([i for i in range(n + 1)], [i for i in range(n + 1)])
	for i in range(n + 1):
		if i == 0 or s[i - 1] == 'R':
			dpl[i] = i
		elif i == 1 or s[i - 2] == 'L':
			dpl[i] = i - 1
		else:
			dpl[i] = dpl[i - 2]
	for i in range(n, -1, -1):
		if i == n or s[i] == 'L':
			dpr[i] = i
		elif i == n - 1 or s[i + 1] == 'R':
			dpr[i] = i + 1
		else:
			dpr[i] = dpr[i + 2]
	print(*[dpr[i] - dpl[i] + 1 for i in range(n + 1)])