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

-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

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int open = 0;
  int closed = 0;
  int hash_tag = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      open++;
    }
    if (s[i] == ')') {
      closed++;
    }
    if (s[i] == '#') {
      hash_tag++;
    }
  }
  if (hash_tag + closed > open) {
    printf("-1\n");
    return 0;
  }
  if (hash_tag == 0 && closed != open) {
    printf("-1\n");
    return 0;
  }
  vector<int> answers;
  int curr_open = 0;
  int curr_closed = 0;
  int curr_hash = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      curr_open++;
    }
    if (s[i] == ')') {
      curr_closed++;
    }
    if (s[i] == '#') {
      curr_hash++;
      if (curr_hash == hash_tag) {
        int volgen = 0;
        for (int j = i + 1; j < s.size(); j++) {
          if (s[j] == ')') {
            volgen++;
          }
        }
        if (open - curr_closed - volgen <= 0) {
          printf("-1\n");
          return 0;
        }
        answers.push_back(open - curr_closed - volgen);
        curr_closed += open - curr_closed - volgen;
      } else {
        answers.push_back(1);
        curr_closed++;
      }
    }
    if (curr_closed > curr_open) {
      printf("-1\n");
      return 0;
    }
  }
  for (int i = 0; i < answers.size(); i++) {
    printf("%d\n", answers[i]);
  }
  return 0;
}
