Squirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval [0, 1]. Next, n stones will fall and Liss will escape from the stones. The stones are numbered from 1 to n in order.

The stones always fall to the center of Liss's interval. When Liss occupies the interval [k - d, k + d] and a stone falls to k, she will escape to the left or to the right. If she escapes to the left, her new interval will be [k - d, k]. If she escapes to the right, her new interval will be [k, k + d].

You are given a string s of length n. If the i-th character of s is "l" or "r", when the i-th stone falls Liss will escape to the left or to the right, respectively. Find the sequence of stones' numbers from left to right after all the n stones falls.


-----Input-----

The input consists of only one line. The only line contains the string s (1 ≤ |s| ≤ 10^6). Each character in s will be either "l" or "r".


-----Output-----

Output n lines — on the i-th line you should print the i-th stone's number from the left.


-----Examples-----
Input
llrlr

Output
3
5
4
2
1

Input
rrlll

Output
1
2
5
4
3

Input
lrlrr

Output
2
4
5
3
1



-----Note-----

In the first example, the positions of stones 1, 2, 3, 4, 5 will be $\frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \frac{3}{16}, \frac{5}{32}$, respectively. So you should print the sequence: 3, 5, 4, 2, 1.

Difficulty: competition

Starter code:

Solutions:
t = input()
a, b = [i for i, d in enumerate(t, 1) if d == 'l'], [i for i, d in enumerate(t, 1) if d == 'r']
a.reverse()
print('\n'.join(map(str, b)))
print('\n'.join(map(str, a)))

inp = input()
length = len(inp)
min,max,dic1,dic2 = 1,length,[],[]
for i in range(0,length):
    if inp[i] == "l":
        dic2.append(i+1)
    else:
        dic1.append(i+1)

print('\n'.join(map(str, dic1)))
print('\n'.join(map(str, dic2[::-1])))

t = input()
a, b = [i for i, d in enumerate(t, 1) if d == 'l'], [i for i, d in enumerate(t, 1) if d == 'r']
a.reverse()
print('\n'.join(map(str, b)))
print('\n'.join(map(str, a)))

s = input()
l = [0] * len(s)
a = 0
b = len(s) - 1
for i in range(len(s)):
	if s[i] == 'l':
		l[b] = str(i + 1)
		b -= 1
	else:
		l[a] = str(i + 1)
		a += 1
print('\n'.join(l))


k = input()
s = []
a = []
b = []
for i in range(len(k)):
    if k[i] == 'l':
        a.append(i+1)
    else:
        b.append(i+1)

a.reverse()
for i in b:
    print(i)

for i in a:
    print(i)


from collections import deque
s=deque(('l'+input())[:-1])
le = []
ri = []
n=0
while s:
    c = 0;ref = s[0]
    while s and s[0] == ref: c+=1;s.popleft()
    #print(ref,c)
    if ref=='l':
        for i in range(c-1):
            ri.append(n+i+1);
        le.append(n+c)
        n=n+c
    elif ref=='r':
        for i in range(c-1):
            le.append(n+i+1);
        ri.append(n+c)
        n=n+c
    #print(le,ri)
le.extend(ri[::-1])
print('\n'.join([str(i) for i in le]))


from sys import stdin, stdout
s = input().strip()
n = len(s)
left = 0
right = n-1
vs = [0]*n
for i in range(n):
	if(s[i] == 'l'):
		vs[right] = str(i+1)
		right -= 1
	else:
		vs[left] = str(i+1)
		left += 1
print('\n'.join(vs))


s = input()
result = [""] * len(s)
l = 0; r = len(s) - 1
for i in range(len(s)):
  if s[i] == 'r':
    result[l] = str(i+1)
    l += 1
  else:
    result[r] = str(i+1)
    r -= 1
from sys import stdout
stdout.write('\n'.join(result))

s=input()
l,r=[],[]
for x in range(len(s)):
    if s[x]=='r':
        r.append(x+1)
    else:
        l.append(x+1)
for el in r:
    print(el)
for el in l[::-1]:
    print(el)

l, r = [], []
for i, c in enumerate(input()):
  if c == 'l':
    r += [str(i + 1)]
  else:
    l += [str(i + 1)]
r.reverse()
print('\n'.join(l + r)) 


s = input()
ans = [0 for i in range(len(s))]
lp = 0
rp = len(s)-1
for i in range(len(s)):
	if s[i]!='l':
		ans[lp] = i+1
		lp+=1
	else:
		ans[rp] = i+1
		rp -= 1
for i in ans:
	print(i)


n = input()
length = len(n)
min,max,arr1,arr2 = 1,length,[],[]
for i in range(0,length):
    if n[i] == "l":
        arr2.append(i+1)
    else:
        arr1.append(i+1)

print('\n'.join(map(str, arr1)))
print('\n'.join(map(str, arr2[::-1])))

MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))

s = input()
n = len(s)
ans = [0]*(n + 1)
l = n
r = 1
stone = 1
for i in s:
	if i == 'l':
		ans[l] = stone
		l -= 1
	if i == 'r':
		ans[r] = stone
		r += 1
	stone += 1
# print(ans)
for i in ans[1:]:
	print(i)

a=list(input())
n=len(a)
for i in range(n):
	if(a[i]=='r'):
		print(i+1)
for i in range(n-1,-1,-1):
	if(a[i]=='l'):
		print(i+1)

s = input()
a, b = [], []
for i, j in zip(s, range(1, len(s)+1)):
    if i == 'r': a.append(str(j))
    else: b.append(str(j))
print('\n'.join(a + b[::-1]))

def main():
    left = -1
    right = -1
    edges = {}
    s = input()

    for i in range(len(s)):
        edges[i+1] = right
        edges[left] = i+1
        if s[i] == 'l':
            right = i+1
        else:
            left = i+1

    curr = edges[-1]
    while curr != -1:
        print(curr)
        curr = edges[curr]
    

main()


s = input()
res = []
for i in range(len(s)):
    if s[i] == 'r':
        res.append(str(i+1))
for i in range(len(s)-1, -1, -1):
    if s[i] == 'l':
        res.append(str(i+1))
print('\n'.join(res)) 


s = input()
l = [0] * len(s)
a = 0
b = len(s) - 1
for i in range(len(s)):
	if s[i] == 'l':
		l[b] = str(i + 1)
		b -= 1
	else:
		l[a] = str(i + 1)
		a += 1
print('\n'.join(l))

def scape(s):
    first = []
    last = []
    it = 1
    for ch in s:
        if ch == "l":
            last.append(it)
        else:
            first.append(it)
        it += 1

    for i in range(len(last)-1, -1,-1):
        first.append(last[i])

    return first

s = input()

ans = []

ans = scape(s)
for i in ans:
    print(i)



s = input()
# list = [1]
# n = len(s)
# index = 0
# for i in range(1,n):
#     if (s[i-1]=="l") :
#         list.insert(index, i+1)
#     else:
#         index += 1
#         list.insert(index, i+1)
# for num in list:
#     print(num)

n = len(s)
ans = [0]*n
left = n-1
right = 0
if (s[0]=="l") :
    ans[n-1] = 1
    left -= 1
else:
    ans[0] = 1
    right += 1
for i in range(1,n) :
    if (s[i]=="l") :
        ans[left] = i+1
        left -= 1
    else:
        ans[right] = i+1
        right += 1
for num in ans:
    print(num)


s=input()
pos1=[]
pos2=[]
n=len(s)
for i in range(n):
    if s[i]=='l':
        pos2.append(i+1)
    else:
        pos1.append(i+1)
for i in pos1:
    print(i)
for i in pos2[::-1]:
    print(i)