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

-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 Main {

    public static StringTokenizer tokenizer;
    public static BufferedReader reader;
    public static PrintWriter writer;

    public static void init() {
//        try {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new OutputStreamWriter(System.out));
//            reader = new BufferedReader(new InputStreamReader(new FileInputStream("notation.in")));
//            writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream("notation.out")));
//        } catch (IOException e) {
//            System.out.println(e);
//            System.exit(1);
//        }
    }

    public static String nextToken() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                System.out.println(e);
                System.exit(1);
            }
        }
        return tokenizer.nextToken();
    }

    public static int nextInt() {
        return Integer.parseInt(nextToken());
    }

    public static long nextLong() {
        return Long.parseLong(nextToken());
    }

    public static byte nextByte() {
        return Byte.parseByte(nextToken());
    }

    public static double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    public static float nextFloat() {
        return Float.parseFloat(nextToken());
    }

    public static short nextShort() {
        return Short.parseShort(nextToken());
    }

    public static void close() {
        try {
            reader.close();
            writer.flush();
            writer.close();
        } catch (IOException e) {
            System.out.println(e);
            System.exit(1);
        }
    }

    public static void main(String[] args) {
        init();
        solve();
        close();
    }

    public static void solve() {
        String s = nextToken();
        char[] ch = s.toCharArray();
        int[][] arr = new int[100001][4];
        int left = 0;
        int right = 0;
        int iSharp = 0;
        boolean can = true;
        for (int i = 0; i < s.length(); i++) {
            if (ch[i] == '(') {
                left++;
            } else  if (ch[i] == ')') {
                right++;
            } else {
                arr[iSharp][0] = i;
                arr[iSharp][1] = left;
                arr[iSharp][2] = right + 1;
                arr[iSharp][3] = 1;
                right++;
                iSharp++;
            }
            if (right > left) {
                can = false;
                break;
            }
        }

        if (can) {
            int add = left - right;
            arr[iSharp - 1][2] += add;
            arr[iSharp - 1][3] = 1 + add;
            left = arr[iSharp - 1][1];
            right = arr[iSharp][2];
//            if (iSharp - 1 < s.length()) {
                for (int i = arr[iSharp - 1][0] + 1; i < s.length(); i++) {
                    if (ch[i] == '(') {
                        left++;
                    } else {
                        right++;
                    }
                    if (right > left) {

                        can = false;
                        break;
                    }
                }
//            }
            if (can) {
                for (int i = 0; i < iSharp; i++) {
                    writer.println(arr[i][3]);
                }
            } else {
                writer.println(-1);
            }
        } else {
            writer.print(-1);
        }
    }
// ((##((((#)#)((#)
}
