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

-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>
static const int N = 100010;
static const int M = 0;
static const int LEN = 50;
static const int MAX = 0x7fffffff;
static const int GMAX = 0x3f3f3f3f;
static const long long LGMAX = 0x3f3f3f3f3f3f3f3f;
static const int MIN = ~MAX;
static const double EPS = 1e-9;
static const int BASE = 1000000007;
static const int CH = 258;
char str[N];
int main() {
  0;
  0;
  while (scanf("%s", str) != EOF) {
    int len = strlen(str);
    int left_brace = 0;
    int right_brace = 0;
    int special = 0;
    int last = -1;
    for (int i = 0; i < len; ++i) {
      if (str[i] == '(') {
        ++left_brace;
      } else if (str[i] == ')') {
        ++right_brace;
      } else {
        ++special;
        last = i;
      }
    }
    if (right_brace + special > left_brace) {
      printf("-1\n");
      continue;
    } else {
      int total = left_brace - right_brace;
      int cur_left = 0;
      int cur_right = 0;
      int cur_special = 0;
      std::vector<int> s;
      bool flag = true;
      for (int i = 0; i < len; ++i) {
        if (cur_right > cur_left) {
          flag = false;
          break;
        }
        if (i == last) {
          if (total > cur_left) {
            flag = false;
            break;
          }
          s.push_back(total);
          cur_right = cur_left;
        } else if (str[i] == '(') {
          ++cur_left;
        } else if (str[i] == ')') {
          ++cur_right;
        } else {
          --total;
          s.push_back(1);
          ++cur_right;
        }
      }
      if (flag == false) {
        printf("-1\n");
        continue;
      }
      for (int i = 0; i < s.size(); ++i) {
        printf("%d\n", s[i]);
      }
    }
  }
  return 0;
}
