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

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

public class C {
    static ArrayList<Integer> index ;
    static ArrayList<Integer> test ;
    static HashMap<Integer,Integer> map;
    static String line;
    static int prev;
    
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        st = new StringTokenizer("");
        sb = new StringBuilder();
        
        char[] in = br.readLine().toCharArray();
        
        boolean beautiful = true;
        int numOpen = 0;
        int numClose = 0;
        int numHash = 0;
//      index = new ArrayList<Integer>();
//      map = new HashMap<Integer,Integer>();
        test = new ArrayList<Integer>();
        prev = -1;
        
        for( int i = 0; i < in.length; i++){
            char c = in[i];
            
            if( c == '(' ){
                numOpen++;
            }else if( c == ')' ){
                numClose++;
            }else{
                int diff = numOpen-numClose;
                
                boolean check = true;
                if( diff == 0 ){
                    check = removePrevious();
                    diff++;
                    numClose--;
                }
                if(!check){
                    beautiful = false;
                    break;
                }
//              index.add(i);
//              map.put(i, diff);
                test.add(diff);
                numClose += diff;
                numHash++;
            }//end if.
            
            if( numClose > numOpen ){
                //removePrevius
                boolean check = removePrevious();
                if( !check ){
                    beautiful = false;
                    break;
                }
                numClose--;
            }//end if.
            
        }//end for i.
        
        if( !beautiful || (numClose != numOpen) ){
            System.out.println("-1");
        }else{
            
            for( int i = 0;i < test.size();i++){
                //sb.append(map.get(index.get(i)) +"\n");
                sb.append( test.get(i) +"\n");
            }
            System.out.print(sb);
        }
        
        
    }//end main.
    
    static boolean removePrevious(){
        int begin = (prev == -1) ? test.size()-1 : prev;
        for( int i = begin;i >= 0; i--){
//          int in = index.get(i);
//          if( !map.containsKey(in) ){
//              return false;
//          }
            int get = test.get(i);
            if( get > 1 ){
//              map.put(in, get-1);
                test.set(i, get-1);
                
                if( prev == -1){
                    prev = i;
                }else{
                    if( test.get(prev) < test.get(i) ){
                        prev = i;
                    }
                }
                
                return true;
            }
        }//end for i.
        
        return false;
    }//end method.

    static BufferedReader br;
    static StringTokenizer st;
    static StringBuilder sb;
    static PrintWriter out;

    static String nxtTok() throws IOException {
        while (!st.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null)
                return null;
            st = new StringTokenizer(s.trim());
        }
        return st.nextToken();
    }

    static int nxtInt() throws IOException {
        return Integer.parseInt(nxtTok());
    }

    static long nxtLng() throws IOException {
        return Long.parseLong(nxtTok());
    }

    static double nxtDbl() throws IOException {
        return Double.parseDouble(nxtTok());
    }

    static int[] nxtIntArr(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nxtInt();
        return a;
    }

    static long[] nxtLngArr(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nxtLng();
        return a;
    }

    static char[] nxtCharArr() throws IOException {
        return nxtTok().toCharArray();
    }
}//end class.