Malek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string *s* written on the door consisting of characters '(', ')' and '#'. Below there was a manual on how to open the door. After spending a long time Malek managed to decode the manual and found out that the goal is to replace each '#' with one or more ')' characters so that the final string becomes beautiful. 

Below there was also written that a string is called beautiful if for each *i* (1 ≤ *i* ≤ |*s*|) there are no more ')' characters than '(' characters among the first *i* characters of *s* and also the total number of '(' characters is equal to the total number of ')' characters. 

Help Malek open the door by telling him for each '#' character how many ')' characters he must replace it with.
The first line of the input contains a string *s* (1 ≤ |*s*| ≤ 10<sup class="upper-index">5</sup>). Each character of this string is one of the characters '(', ')' or '#'. It is guaranteed that *s* contains at least one '#' character.
import sys
input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp(): # int
    return(int(input()))
def inlt(): # list
    return(list(map(int,input().split())))
def insr(): # string as char list
    s = input()
    return(list(s[:len(s) - 1]))
def instr(): # string
    return input()
def invr(): # spaced ints
    return(map(int,input().split()))

chrs = insr()
balance = 0
ans = []
num_pos = 0
num_wild = 0
last_wild = -1
for i, c in enumerate(chrs):
    num_pos += (c == '(')
    num_wild += (c == '#')
    if c == '#':
        last_wild = i

skip = False
num_neg = len(chrs) - num_pos
if num_neg > num_pos:
    skip = True
    print(-1)
elif num_wild == 0:
    if num_neg == num_pos:
        skip = True
        print()
    else:
        skip = True
        print(-1)
else:
    ans = [1] * num_wild
    wild_idx = 0
    balance = 0
    for i in range(last_wild):
        c = chrs[i]
        if c == '(':
            balance += 1
        else:
            balance -= 1
            if balance < 0:
                skip = True
                # print(i)
                print(-1)
                break
    ans[-1] += num_pos - num_neg
    for i in range(last_wild + 1, len(chrs)):
        c = chrs[i]
        if c == '(':
            balance += 1
        else:
            balance -=1
            if balance < 0:
                skip = True
                # print(i)
                print(-1)
                break
    if not skip:
        for a in ans:
            print(a)



    # for i, c in chrs:
    #     if c == '(':
    #         balance += 1
    #     elif c == '(':
    #         balance -= 1
    #     else: # c == '#'
    #         balance -= 1
    #         ans[wild_idx] += balance
    #         wild_idx += 1




#
#
# for i, c in enumerate(chrs):
#     if c == '(':
#         balance += 1
#     elif c == ')':
#         balance -= 1
#         if balance < 0:
#             if not ans:
#                 print(-1)
#                 break
#             ans[-1] +=
#             balance = 0
#     else: # c == '#'
#         balance -= 1
#         ans.append(1)




