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

-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 CodeForces {

    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        String s = Reader.next();
        
        int x = 0;
        int last = 0;
        StringBuilder ans = new StringBuilder();
        
        for(int i = 0 ;i  < s.length(); i++){
            if(s.charAt(i) == '(')
                x++;
            else if(s.charAt(i) == ')')
                x--;
            else{
                ans.append(1).append('\n');
                x--;
                last = i;
            }
            
            if(x < 0){
                System.out.println("-1");
                return;
            }
        }
        
        if(ans.length() != 0){
            ans.deleteCharAt(ans.length()-1);
            ans.deleteCharAt(ans.length()-1);
            
            ans.append(x+1).append('\n');
           
            x = 0;
            for(int i = last+1; i < s.length(); i++){
                if(s.charAt(i) == '(')
                    x++;
                else
                    x--;
                if(x < 0){
                    System.out.println("-1");
                    return;
                }
            }
            
             System.out.print(ans);
            
        }
        
        else
            System.out.println("-1");
    }
}


class  Edge implements Comparable<Edge>{

        int to;
        int from;
        int cost;
        
        Edge(int a, int b, int c){
            from = a;
            to = b;
            cost = c;
        }

        @Override
        public int compareTo(Edge t) {
            return t.cost - cost;
        }
    }


    class NN implements Comparable<NN>{
        int x;
        int mod;
        
        NN(int a, int b){
            x = a;
            mod = b;
        }

        @Override
        public int compareTo(NN t) {
            return mod - t.mod;
        }
        
    }
    

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

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

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }