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

-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 Treasure {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner stdin = new Scanner(System.in);
        String input = stdin.nextLine();
        
        int index = 0;
        
        int open = 0;
        StringBuffer sb = new StringBuffer();
        int lastIndex = 0;
        int maxLast = 0;
        
        while (index < input.length()) {
        	
        	if (input.charAt(index) == '(') {
        		open++;
        	} else if (input.charAt(index) == '#') {
        		sb.append (1 + "\n");
        		maxLast = open;
        		open--;
        		lastIndex = index;
        	} else {
        		open--;
        	}
        	
        	if (open < 0) {
        		System.out.println(-1);
        		return;
        	}
        	index++;
        }
        
        index = lastIndex+1;
        sb.delete(sb.toString().length()-2, sb.toString().length());
        open++;
        
        if (open > maxLast) {
        	System.out.println(-1);
    		return;
        }
        sb.append(open);
        /*System.out.println(sb.toString());
        open = 0;
        */
        index = 0;
        int counter = 0;
        open = 0;
        while (index < input.length()) {
        	
        	if (input.charAt(index) == '(') {
        		open++;
        	}  else if (input.charAt(index) == '#'){
        		open -= sb.toString().charAt(counter) - '0';
        		counter = counter+2;
        	} else {
        		open--;
        	}
        	
        	if (open < 0) {
        		System.out.println(-1);
        		return;
        	}
        	index++;
        }
        if (open == 0) {
        	System.out.println(-1);
        } else {
        	System.out.println(sb.toString());
        }
	}

}
