#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string str;
  long long i, j;
  cin >> str;
  long long n = str.length();
  long long cnt = 0;
  vector<long long> res;
  long long flag = 0;
  for (i = 0; i < n; i++) {
    if (str[i] == '(')
      cnt++;
    else if (str[i] == ')')
      cnt--;
    else {
      res.push_back(cnt);
      if (cnt < 1) {
        flag = 1;
        break;
      }
    }
    if (cnt < 0) {
      flag = 1;
      break;
    }
  }
  if (flag || cnt < res.size())
    cout << -1 << "\n";
  else {
    long long temp = 1;
    flag = 0;
    cnt -= res.size();
    vector<long long> fin(res.size(), 1);
    for (i = 0; i < fin.size(); i++) {
      res[i] -= temp;
      temp++;
      if (res[i] < 0) {
        flag = 1;
        break;
      }
    }
    i = fin.size() - 1;
    temp = 0;
    while (i >= 0) {
      if (cnt > res[i]) {
        cnt -= res[i];
        fin[i] += res[i];
        i--;
      } else {
        fin[i] += cnt;
        cnt = 0;
        break;
      }
    }
    if (flag || (cnt != 0))
      cout << -1 << "\n";
    else {
      j = 0;
      for (i = 0; i < n; i++) {
        if (str[i] == '(')
          cnt++;
        else if (str[i] == ')')
          cnt--;
        else
          cnt -= fin[j++];
        if (cnt < 0) {
          flag = 1;
          break;
        }
      }
      if (cnt != 0 || flag) {
        cout << -1 << "\n";
        return 0LL;
      }
      for (i = 0; i < fin.size(); i++) cout << fin[i] << "\n";
    }
  }
}
