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

-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.Scanner;

public class Main {

		public static void main(String[] args) {
			final2();
		}
		public static void final2(){
		    Scanner scan = new Scanner(System.in);
		    String str = scan.nextLine();
		    boolean flag = false;
		    int open = 0;
		    int openSum = 0;
		    int closed = 0;
		    int closedSum = 0;
		    char temp;
		    int array [] = new int [str.length()];  
		    int j = 0;
		    
		    for(int i = 0; i < str.length(); i++) {
		    		temp = str.charAt(i);
		    		if(flag == false) {
		    			if( temp == '(')
		    				open++;
		    			else if(temp == ')')
		    				closed++;
		    			else
		    				flag = true;
		    		}
		    		else {
		    			if( temp == '(')
		    			{
		    				i--;
		    				flag = false;
		    				//System.out.println(open-closed);
		    				array[j]=open-closed;
		    				j++;
		    				openSum += open;
		    				openSum -= closed;
		    				if(openSum < 0) {
		    					System.out.println("-1");
		    					return;
		    				}
		    				open = 0;
		    				closed = 0;
		    				
		    				
		    			}
		    			else
		    				if(open - closed !=0)
		    					closed++;
		    			
		    		}
		    }
		    //System.out.println(open-closed);
		    array[j]=open-closed;
		    j++;
		    if(openSum > 0) {
		    		for(int i = 0; i < j; i++)
		    			if(array[i] > 0)
		    			System.out.println(array[i]);
		    }
		    else
		    	System.out.println("-1");
		    	
		
		
		}
}