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

-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.*;
import java.io.*;
 
public class File {
	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		
		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e) {
					e.printStackTrace();
				}
			}
			
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
	
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		
		
		
		
		String s = sc.next();
		Deque<Integer> deque = new ArrayDeque<>();
		
		int L = 0;
		int N = s.length();
		
		boolean isPossible = true;
		
		for (int i = N-1; i >= 0; i--) {
			if (s.charAt(i) == '(') {
				L++;
			}
			else if (s.charAt(i) == ')') {
				L--;
			}
			else {
				L--;
				deque.addFirst(1);
			}
			
			// Lefts must be paired up, or else it's not possible.
			if (L > 0) {
				if (deque.isEmpty()) {
					isPossible = false;
					break;
				}
				else {
					// Add the needed right to the leftmost right.
					int R = deque.pollFirst();
					deque.addFirst(R+1);
					L--;
				}
			}
		}
		
		if (L != 0) {
			isPossible = false;
		}
		
		if (isPossible) {
			if (deque.size() == 0) {
				out.println(0);
			}
			else {
				for (int right : deque) {
					out.println(right);
				}
			}
		}
		else {
			out.println(-1);
		}
		
		
		
		out.close();
	}
}