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

-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.FileNotFoundException;
import java.util.Scanner;
import java.util.Stack;

public class A {
    public static void main(String zargs[]) throws FileNotFoundException {

        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        Stack<Character> stack = new Stack<Character>();

        int curr = 0;
        boolean poss = true;
        for (int i = 0; i < s.length(); i++) {

            if (s.charAt(i) == '(') {
                while (curr > 0) {
//                    System.out.println("pushing #");
                    stack.push('#');
                    curr--;
                }
                stack.push('(');
//                System.out.println("pushing (");
            } else {
                if (s.charAt(i) == '#')
                    curr++;
                boolean popped = false;
                while (!stack.empty()) {
                    Character ch = stack.pop();
//                    System.out.println("popped (");
                    if (ch == '#')
                        curr++;
                    else {
                        popped = true;
                        break;
                    }
                }

                if (!popped) {
                    poss = false;
                    break;
                }
            }
        }

//        System.out.println(curr);
        while (curr > 0) {
//            System.out.println("pushing #");
            stack.push('#');
            curr--;
        }

//        for (Character c : stack)
//            System.out.print(c);
//        System.out.println();


        if (stack.isEmpty() || stack.peek() != '#')
            poss = false;

        if (!poss)
            System.out.println(-1);
        else {
            int count = 1;

            for (Character c : stack) {
                if (c == '#') {
                    System.out.println(count);
                    count = 1;
                } else count++;
            }

        }
    }
}
