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

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

//           THIS TEMPLATE MADE BY AKSH BANSAL.

public class Solution {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) throws IOException {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        // ________________________________

        // int t = sc.nextInt();
        // StringBuilder output = new StringBuilder();

        // while (t-- > 0) {

        //     output.append(solver()).append("\n");
        // }

        // out.println(output);
        // _______________________________

        String s = sc.nextLine();
        solver(s,out);
        // ________________________________
        out.flush();
    }
    /** 
        2d array - [[x1,y1],[x2,y2],[x3,y3]...] 
            x --> number of possible ')'        
            y --> number of ')' actually places(default: 0)
     */
    public static void solver(String s, PrintWriter out) {
        int len = s.length();
        List<int[]> arr = new ArrayList<>();
        int cur = 0;
        int extra = 0;
        for(int i=0;i<len;i++){
            char c = s.charAt(i);
            if(c==')'){
                cur--;
                if(extra>0)extra--;
            }
            else if(c=='('){
                cur++;
                extra++;
            }
            else{
                if(cur==0){
                    out.println(-1);
                    return ;
                }else{
                    arr.add(new int[2]);
                    int last = arr.size();
                    arr.get(last-1)[0] = cur;
                    arr.get(last-1)[1] = 1;
                    cur--;
                    extra=0;
                }
            }
            if(cur<0){
                out.println(-1);
                return ;
            }
        }
        if(extra>0){
            out.println(-1);
            return;
        }
        if(cur==0){
            for(int[] e: arr){
                out.println(e[1]);
            }
            return;
        }
        for(int i=arr.size()-1;i>=0 && cur>0;i--){
            arr.get(i)[1] = 1+Math.min(cur,arr.get(i)[0]-arr.get(i)[1]);
            cur-=arr.get(i)[1]-1;
        }

        for(int[] e: arr){
            out.println(e[1]);
        }
    }
}