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

-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

s = input()
ans = ''
bal = 0
was = 0
for i in range(len(s)):
    if s[i] == '(':
        if was > 0 and bal > 0:
            ans += str(bal) +'\n'
            for i in range(was - 1):
                ans += '0\n'
            bal = 0
        was = 0
        bal += 1
    elif s[i] == ')':
        bal -= 1
    else:
        was += 1
    #print(i + 1, bal, was)

if was > 0 and bal > 0:
    ans += str(bal) +'\n'
    for i in range(was - 1):
        ans += '0\n'
elif was != 0 or bal != 0:
    print(-1)
    exit(0)
print(ans)
