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

-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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
	boolean[] is_prime;
	int max;
	public void sieve(){
		max = (1<<29)+(1<<27)+(1<<24)+(1<<23);
		//System.out.println(max);
		is_prime = new boolean[max+1];
		is_prime[0] = is_prime[1] = true;
		for(int i = 2; i*i < max; i++){
			if(!is_prime[i]){
				for(int j = i*i; j <= max; j+=i){
					is_prime[j] = true;
				}
			}
		}
	}
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        char[] input = in.next().toCharArray();
        int n = input.length , j = 0;
        boolean bool = false;
        int left = 0,right = 0;
        int ans[] = new int[n];
        for(int i = 0; i < n; i++){
        	if(input[i] == '('){++left;
        	}
        	else if(input[i] == ')'){
        		++right;
        		if(left > 0 && right > 0)
        		{--left; -- right;}
        		if(j > 0 && bool && ans[j-1] > 1 && right > 0){
        			ans[j-1]--;
        			--right;
        		}
        	}
        	else{
        		ans[j] = (left - right);
        		j++;
        		bool = true;
        		left = 0;
        		right = 0;
        	}
	
        }
        
        for(int i = 0; i < j; i++)
    		if(ans[i] <= 0){
    			out.println(-1);
    			return;
    		}
        for(int i = 0; i < j; i++)
    		 out.println(ans[i]);
    			
    }
  }
 class pair implements Comparable<pair>{
	 public int first,second;
	 public pair(){
		 first = second = 0;
	 }
	@Override
	public int compareTo(pair arg0) {
		if(this.first > arg0.first)
			return 1;
		else if(this.first < arg0.first)
			return -1;
		if(this.first == arg0.first){
			if(this.second > arg0.second)
				return 1;
			else if(this.second < arg0.second)
				return -1;
            }
		return 0;
	}
 }
class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public Integer nextInt() {
        return Integer.parseInt(next());
    }
    
    public Long nextLong() {
    	return Long.parseLong(next());
    }
    
    public Double nextDouble() {
    	return Double.parseDouble(next());
    }
    
    public Float nextFloat() {
    	return Float.parseFloat(next());
    }
    
    public BigInteger nextBigInteger() {
    	return new BigInteger(next());
    }
    
    public String nextLine() {
    	try {
			return reader.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
    	
    }
    
    public Integer[] nextIntegerArray(int n) {
    	Integer[] a = new Integer[n];
    	for(Integer i = 0; i <  n; i++)
    		a[i] = nextInt();
    	
    	return a;
    }
    
    public Long[] nextLongArray(int n) {
    	Long[] a = new Long[n];
    	for(Integer i = 0; i <  n; i++)
    		a[i] = nextLong();
    	
    	return a;
    }
    
    public long[] nextlongArray(int n) {
    	long[] a = new long[n];
    	for(Integer i = 0; i <  n; i++)
    		a[i] = nextLong();
    	
    	return a;
    }

    public String[] nextStringArray(int n){
    	String[] s = new String[n];
    	for(Integer i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }
    
    public String[] nextLineStringArray(int n){
    	String[] s = new String[n];
    	for(Integer i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }

    
    }