#include <bits/stdc++.h>
using namespace std;
void dbg_out() { cerr << "\b\b]\n"; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << H << ", ";
  dbg_out(T...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  int n = (int)s.size();
  int curr = 0, last = -1;
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    if (s[i] == ')')
      curr--;
    else if (s[i] == '(')
      curr++;
    else {
      if (curr <= 0) {
        cout << -1;
        return 0;
      }
      last = i;
      curr--;
      ans.push_back(curr);
    }
    if (curr < 0) {
      cout << -1;
      return 0;
    }
  }
  if (last > -1) {
    int x = 0, neg = 0;
    for (int i = n - 1; i > last; --i) {
      if (s[i] == ')')
        x--;
      else if (s[i] == '(')
        x++;
      if (x > 0) {
        cout << -1;
        return 0;
      }
    }
    x = 0;
    for (int i = last + 1; i < n; ++i) {
      if (s[i] == ')')
        x--;
      else if (s[i] == '(')
        x++;
      neg = min(neg, x);
    }
    neg = ans.back() + neg;
    if (x > 0 or neg < 0) {
      cout << -1;
      return 0;
    }
    ans.pop_back();
    ans.push_back(neg + 1);
  }
  for (int i = 0; i < (int)ans.size(); ++i) {
    if (i + 1 == (int)ans.size()) {
      cout << ans[i] << '\n';
    } else
      cout << 1 << '\n';
  }
  return 0;
}
