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

-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 SolutionC {
    public void solve(){
        nextLine();
        StringBuilder sb = new StringBuilder(line);
        int d = 0 , h = 0 , j = -1;
        for (int i = 0; i < sb.length(); i++) {
            if(sb.charAt(i)=='(')
                d++;
            else if(sb.charAt(i) == ')')
                d--;
            else{
                h++;
                j=i;
            }
        }
        if(h > d){
            out.println(-1);
            out.flush();
            return;
        }
        for(int i = 0 ; i < sb.length() ; i++){
            if(sb.charAt(i) == '#')
            if(i==j){
                StringBuilder s = new StringBuilder();
                for(int k = 0 ; k < d - h + 1 ; k++)
                    s.append(")");
                sb.replace(i, i+1, s.toString());
            }else{
                sb.setCharAt(i, ')');
            }
        }
        int c = 0;
        for(int i = 0 ; i < sb.length() ; i++){
            if(sb.charAt(i) == '(')
                c++;
            else
                c--;
            if(c < 0){
                out.println(-1);
                out.flush();
                return;
            }
        }
        for(int k = 0 ; k < h - 1 ; k++)
            out.println(1);
        out.println(d - h +1);
        out.flush();
    }
    public static void main(String args[]){
        new SolutionC().solve();
    }
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);
    String line;
    StringTokenizer st;
    public void nextLine(){
        try {
            line = bf.readLine();
            st = new StringTokenizer(line);
        } catch (IOException e) {
            System.out.println("1010 0111 1010");
        }
    }
    public int nextInt(){
        return Integer.parseInt(st.nextToken());
    }
    public long nextLong(){
        return Long.parseLong(st.nextToken());
    }
    public double nextDouble(){
        return Double.parseDouble(st.nextToken());
    }
}
