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

-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 l = (int)s.size();
  int i = 0;
  int count_left = 0;
  int possible = true;
  vector<int> answer;
  vector<int> v;
  while (i < l) {
    if (s[i] == '(') {
      count_left++;
      i++;
      continue;
    } else if (s[i] == ')') {
      count_left--;
      i++;
      continue;
    } else {
      int count_hash = 1;
      int j = i + 1;
      while (j < l) {
        if (s[j] == '(')
          break;
        else if (s[j] == ')')
          count_left--;
        else
          count_hash++;
        j++;
      }
      v.push_back(j);
      i = j;
      if (count_left >= count_hash) {
        count_left = count_left - count_hash;
        for (int i = 0; i < count_hash; i++) answer.push_back(1);
      } else {
        possible = false;
        break;
      }
    }
  }
  int counter = 0;
  for (int i = v[v.size() - 1]; i < l; i++) {
    if (s[i] == '(')
      counter++;
    else if (s[i] == ')')
      counter--;
    else
      counter = 0;
  }
  if (possible && counter == 0) {
    answer[answer.size() - 1] += count_left;
    for (int i = 0; i < answer.size(); i++) cout << answer[i] << endl;
  } else
    cout << -1;
}
