#(#(#((##((()))(((#)(#()#(((()()(()#(##(((()(((()))#(((((()(((((((()#((#((()(#(((()(()##(()(((()((#(
 (#((((()
 (#((
 ((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((##
 (())((((#)
 (#(
 (#))(#(#)((((#(##((#(#((((#(##((((((#((()(()(())((()#((((#((()((((#(((((#(##)(##()((((()())(((((#(((
 ##((((((()
 #((#
 #))))
 (((((#(#(#(#()
 ((#(()#(##
 (((((((((((((((((((###################
 )((##((###
 (((()#(#)(
 ((#)(
 )(((())#
 ()((#((#(#()
 ((#(
 ()#(#())()()#)(#)()##)#((()#)((#)()#())((#((((((((#)()()(()()(((((#)#(#((((#((##()(##(((#(()(#((#))#

-1
 -1
 -1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 3
 -1
 -1
 -1
 -1
 -1
 1
1
1
5
 1
1
1
1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 -1
 -1
 -1
 -1
 1
1
3
 -1
 -1

i = input()

l = len(i)
leach = [0]*l + [0]
hashs = []

for x in range(l):
    if i[x] == '#':
        leach[x+1] = leach[x]
        hashs.append(x+1)
    elif i[x] == '(':
        leach[x+1] = leach[x] + 1
    else:
        leach[x+1] = leach[x] - 1

mins = [10**9] + [0] * (l+1)
for y in range(1, l+1):
    mins[y] = min(mins[y-1], leach[-y])
mins = mins[1:]
mins.reverse()

ct = i.count('#')
need = i.count('(') - i.count(')')
if ct > need:
    print(-1)
else:
    most = need - (ct - 1)
    balance = ''
    allx = []
    key = 0
    for z in hashs:
        req = min(mins[z] - key, most)
        if req < need:
            need -= req
            allx.append(req)
            key += req
        elif req >= need:
            allx.append(need)
            need = 0
    if need > 0:
        print(-1)
    else:
        for a in allx:
            print(a)
