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

-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

import itertools


s = input()
# s = ")((#"
blocks = s.split("#")
counts = []
for block in blocks:

    counts.append(len(block) - 2 * block.count(")"))

*counts, balance = counts
brackets = []
for count in reversed(counts):

    bracket = max(1, balance + count)
    balance += count - bracket
    brackets.append(bracket)

rs = ""
for prefix, count in itertools.zip_longest(blocks, reversed(brackets), fillvalue=0):

    rs += prefix + ")" * count

def check(s):

    count = 0
    for ch in s:

        if ch == "(":

            count += 1

        elif count > 0:

            count -= 1

        else:

            return False

    return True

if balance == 0 and check(rs):

    print("\n".join(map(str, reversed(brackets))))

else:

    print(-1)
