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

-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

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void main()
{
    string word ;
    int arr [3] = {0,0,0};
    cin >> word;
    for (int i = 0; i < word.length(); i++)
    {
        if (word.at(i) == '(')
            arr[0]++;
        else if (word.at(i) == ')' )
            arr[1]++;
        else
            arr[2]++;
    }
    int *arr1 = new int [arr[2]];
    if ( arr[1] >= arr[0] )
        cout << "-1";
    else
    {
        int index = 0 ;
        int possible = arr[0] - arr[1];
        int possibleregion = 0;
        for (int i = 0; i < word.length(); i++)
        {
            if (word.at(i)=='(')
                possibleregion++;
            else if ( word.at(i) == ')' )
                possibleregion--;
            else
            {
                int j ;
                if(word.find('(',i+1) == -1 )
                    j = word.length() - 1 - i;
                else
                    j = word.find('(',i+1) - i - 1 ;
                if (arr[2]==1)
                    arr1[index]=possible;
                else
                    arr1[index] = min(possibleregion-j , possible-arr[2] );
                arr[2]--;
                possibleregion -= arr1[index];
                possible -= arr1[index++];
                i = word.find('(',i+1) -1;
            }
        }
        for (int i = 0; i < index; i++)
            cout << arr1[i] << endl ;
    }
}