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

-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;
long long mod = 1000000000 + 7;
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int counter1 = 0;
  int counter2 = 0;
  int counter3 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      counter1++;
    } else if (s[i] == ')') {
      counter2++;
    } else if (s[i] == '#') {
      counter3++;
    }
  }
  if (counter2 >= counter1 || s[0] == ')' || s[s.size() - 1] == '(') {
    cout << -1;
    return 0;
  }
  counter1 = 0;
  counter2 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      counter1++;
    } else if (s[i] == '#' && counter1) {
      counter1 = 0;
    } else if (s[i] == ')' && counter1) {
      counter2++;
      if (counter1 == counter2) {
        counter1 = 0;
        counter2 = 0;
      }
    }
  }
  if (counter1 || counter2) {
    cout << -1;
    return 0;
  }
  counter1 = 0;
  counter2 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      counter1++;
    } else if (s[i] == '#') {
      for (int j = i + 1; j < s.size() && s[j] == ')'; j++) {
        counter2++;
      }
      cout << counter1 - counter2 << endl;
      counter1 = 0;
      counter2 = 0;
    } else if (counter1 && s[i] == ')') {
      counter2++;
      if (counter1 == counter2) {
        counter1 = 0;
        counter2 = 0;
      }
    }
  }
  return 0;
}
