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

-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 java.util.*;
public class Main {

    public static void main(String[] args) {


        String inputString = null,finalString = "";
        int leftCount = 0;
        int rightCount = 0;
        int step = 0,flag = 0;
        Scanner scanner = new Scanner(System.in);
        inputString = scanner.next();


        for(int i=0; i<inputString.length(); i++)
        {
            if(inputString.charAt(i) == '(')
            {
                if(step == 1)
                {
                    int diff = (leftCount - rightCount);
                    if(diff == 0 || diff < 0)
                    {
                        finalString = "-1";
                        break;
                    }
                    finalString += diff + "\n";
                    //System.out.println(finalString);
                    leftCount = 0;
                }
                //System.out.println(leftCount);
                leftCount++;
                rightCount = 0;
                step = 0;

            }
            else if(inputString.charAt(i) == '#')
            {
                step = 1;
                if((i+1) == inputString.length())
                {
                    int diff = (leftCount - rightCount);
                    if(diff == 0 || diff < 0)
                    {
                        finalString = "-1";
                        break;
                    }
                    finalString += diff + "\n";                 
                }
                if(leftCount == 0 && rightCount == 0)
                {
                    finalString = "-1";
                    break;
                }
            }

            else if(inputString.charAt(i) == ')')
            {
                flag = 1;
                rightCount++;
                if((i+1) == inputString.length())
                {
                    if(step == 1)
                    {
                        int diff = (leftCount - rightCount);
                        if(diff == 0 || diff < 0)
                        {
                            finalString = "-1";
                            break;
                        }
                        //System.out.println(tempString);
                        finalString += diff +"\n";
                        step = 0;
                    }
                }
                else
                {   
                    if(step == 1)
                    {
                        int diff = (leftCount - rightCount);
                        if(diff == 0 || diff < 0)
                        {
                            finalString = "-1";
                            break;
                        }
                        //System.out.println(tempString);
                        finalString += diff +"\n";
                        step = 0;
                    }
                    //System.out.println("hellob");    
                    leftCount = 0;
                    // System.out.println("helloa");    
                }
            }
            //System.out.println(leftCount+"-" + rightCount);
        }
        System.out.print(finalString);
        scanner.close();
    }

}