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

-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;
inline bool is_palindrome(const string& s) {
  return std::equal(s.begin(), s.end(), s.rbegin());
}
const long long MOD = 1000000007;
const long long INF = 1e9 + 5;
const double eps = 1e-7;
const double PI = acos(-1.0);
inline void debug_vi(vector<int> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
inline void debug_vll(vector<long long> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
vector<int> ans;
void solve(string part) {
  int sz = part.size(), last = 0, index = -1;
  for (long long i = (long long)(0); i < (long long)(sz); i++) {
    if (part[i] == '#') {
      last = ans.size();
      index = i;
      ans.push_back(1);
    }
  }
  if (index == -1) return;
  int cnt = 0;
  for (long long i = (long long)(sz - 1); i >= (long long)(index + 1); i--) {
    if (part[i] == ')') {
      cnt++;
    } else if (part[i] == '(')
      cnt--;
  }
  for (long long i = (long long)(0); i < (long long)(index); i++) {
    if (part[i] == ')') {
      cnt++;
    } else if (part[i] == '(') {
      cnt--;
    }
  }
  ans[last] += abs(cnt);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int a = 0, b = 0, sz = s.size();
  string part = "";
  for (long long i = (long long)(0); i < (long long)(sz); i++) {
    part.push_back(s[i]);
    if (s[i] == '(') {
      a++;
    } else if (s[i] == ')') {
      b++;
      if (b > a) {
        cout << -1;
        return 0;
      }
      if (i == sz - 1 || s[i + 1] == '(') {
        solve(part);
        part = "";
        a = 0;
        b = 0;
      }
    } else {
      b++;
      if (b > a) {
        cout << -1;
        return 0;
      }
      part.push_back(')');
    }
  }
  for (long long i = (long long)(0); i < (long long)(ans.size()); i++) {
    cout << ans[i] << "\n";
  }
  return 0;
}
