#include <bits/stdc++.h>
using namespace std;
int sum[100005], sz;
vector<int> v, ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  sz = s.size();
  int pos = -1, add = 0;
  for (int i = sz - 1; i >= 0; i--) {
    if (s[i] == ')')
      add--;
    else if (s[i] == '(')
      add++;
    else {
      sum[i] = -1;
      pos = i;
      add--;
    }
    if (add > 0 && pos != -1) {
      sum[pos] -= add;
      add = 0;
    } else if (add > 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  if (sum[0] < 0) {
    cout << -1 << endl;
    return 0;
  }
  sum[0] = (s[0] == '(') ? 1 : -1;
  for (int i = 1; i < (int)sz; i++) {
    if (s[i] == '(')
      sum[i] = sum[i - 1] + 1;
    else if (s[i] == ')')
      sum[i] = sum[i - 1] - 1;
    else {
      ans.push_back(-sum[i]);
      sum[i] = sum[i] + sum[i - 1];
    }
    if (sum[i] < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < (int)ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
