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

-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.*;
import java.util.*;

public class C {

	static int  n;

	static char [] c ;
	
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		c = sc.next().toCharArray();
		
		
		int open = 0 ;
		int close = 0;
		int change = 0 ;
		
		StringBuilder st = new StringBuilder();
		
		n = c.length;
		
		for(int i = 0 ; i < n ; i++)
			if(c[i] == '(')
				open++;
			else if(c[i] == ')')
				close++;
			else
				change ++ ;
		
			
		if(close + change > open || (change == 0 && open != close) )
		{
			System.out.println(-1);
			return;
		}
		
		int rem = open - close ;
		open  = 0 ;
		close = 0 ;
		 
		boolean f = true;
		
		for(int i = 0 ; i < n ; i++)
		{
			
			if(c[i] == '(')
				open++;
			else if(c[i] == ')')
				close++;
			else {
				
				change -- ;
				
				if(change == 0) {
					st.append(rem).append("\n");
					if(open < close + rem)
						f = false;
					close+=rem;
						
				}
				else {
					st.append(1).append("\n");
					if(open < close + 1)
						f = false;
					close++;
					
					
					
				}
				rem -- ;
				
			}
			
			if(open < close )
				f = false;
			
			
			
		}
		
		
		System.out.print(f ? st : -1);	
		
		

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}									
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}


}
