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

-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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;

public class Treasure {

    public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(System.out);
	String line = br.readLine();

	int length = line.length();
	int openCount = 0;
	int closeCount = 0;
	int hashCount = 0;
	for (int i = 0; i < length; i++) {
	    if (closeCount > openCount || hashCount > openCount) {
		System.out.println(-1);
		return;
	    }
	    if (line.charAt(i) == '(')
		openCount++;
	    else if (line.charAt(i) == ')')
		closeCount++;
	    else
		hashCount++;
	}

	int sol = openCount-closeCount - (hashCount-1);

	if (sol <= 0) {
	    out.println(-1);
	}
	else {
	    ArrayList<Integer> ans = new ArrayList<>();
	    for (int j = 0; j < hashCount-1; j++) {
		out.println(1);
		ans.add(1);
	    }
	    out.println(sol);
	    ans.add(sol);

	    int c = 0;
	    int k = 0;
	    for (int i = 0; i < length; i++) {
		if (c < 0) {
		    System.out.println(-1);
		    return;
		}
		if (line.charAt(i) == '(')
		    c++;
		else if (line.charAt(i) == ')')
		    c--;
		else 
		    c -= ans.get(k++);
	    }
	    if (c != 0) {
		System.out.println(-1);
		return;
	    }
	}
	out.flush();
	out.close();
    }

}
