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

-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.util.ArrayList;

public class Treasure {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));
        String code = reader.readLine();
        reader.close();
        int openBracketCount = 0;
        int closeBracketCount = 0;
        int hashCount = 0;
        boolean flag = true;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= code.length() - 1; i++) {
            if (code.charAt(i) == '(') {
                ++openBracketCount;
            } else if (code.charAt(i) == '#') {
                ++hashCount;
                if (i == code.length() - 1) {
                    list.add(openBracketCount);
                    openBracketCount = 0;
                } else if (code.charAt(i + 1) == '(') {
                    list.add(openBracketCount);
                    openBracketCount = 0;
                    hashCount = 0;
                } else if (code.charAt(i + 1) == ')') {
                    int j;
                    for (j = i + 1; j <= code.length() - 1; j++) {
                        if (code.charAt(j) != '(') {
                            ++closeBracketCount;
                        } else {
                            break;
                        }

                    }
                    if (openBracketCount == closeBracketCount
                            || closeBracketCount > openBracketCount) {
                        flag = false;
                        break;
                    } else {
                        list.add(openBracketCount - closeBracketCount);
                        openBracketCount = 0;
                        closeBracketCount = 0;
                        hashCount = 0;
                    }
                    i = j - 1;
                }
            } else if (code.charAt(i) == ')') {
                ++closeBracketCount;
            }

            if (openBracketCount == closeBracketCount) {
                openBracketCount = 0;
                closeBracketCount = 0;
            }
        }

        if (hashCount > 0 && openBracketCount == 0) {
            System.out.println(-1);
        } else if (flag) {
            for (Integer i : list) {
                System.out.println(i);
            }
        } else {
            System.out.println(-1);
        }
    }
}
