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

-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 A {
    Scanner in = new Scanner(System.in);

    public void solve() {

        /*int a = in.nextInt();
        int b = in.nextInt();
        if (a == b) {
            System.out.println("infinity");
        }
        boolean[] may = new boolean[a];
        Arrays.fill(may, true);
        for (int i = 0; i < a; i++) {

        }*/
        ArrayList<Integer> arr = new ArrayList<Integer>();
        String s = in.next();
        int stack = 0;
        for (int i = 0; i < s.length(); i++) {
            switch(s.charAt(i)) {
                case '(':
                    stack++;
                    break;
                case '#':
                    i++;
                    while (i < s.length() && s.charAt(i) == ')') {
                        i++;
                        stack--;
                    }
                    arr.add(stack);
                    stack = 0;
                    i--;
                    break;
                case ')':
                    stack--;
            }
        }
        if (arr.contains(0)) {
            System.out.println(-1);
        }
        else
            for (int i : arr)
                System.out.println(i);
    }

    public void run() {
        solve();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

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

    public static void main(String[] args) {
        new A().run();
    }
}