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

-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.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author thnkndblv
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        char[] c = ("#" + in.next()).toCharArray();
        int n = c.length;
        int[] a = new int[n];

        int last = 0;
        int count = 0;
        for (int i = 1; i < n; i++) {
            if (c[i] == '(') count++;
            else if (c[i] == ')') {
                count--;
                if (count < 0) {
                    out.println(-1);
                    return;
                }
            } else {
                a[i] = count - last;
                last = count;
            }
        }

        count = 0;
        ArrayList<Integer> stk = new ArrayList<>();
        for (int i = n - 1; i > 0; i--) {
            if (c[i] == ')') count++;
            else if (c[i] == '(') {
                count--;
                if (count < 0) {
                    out.println(-1);
                    return;
                }
            } else {
                int x = Math.max(a[i] - count, 1);
                count += x;
                stk.add(x);
            }
        }

        if (count != 0) {
            out.println(-1);
        } else {
            for (int i = stk.size() - 1; i >= 0; i--) {
                out.println(stk.get(i));
            }
        }
    }
}
