#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string t;
  cin >> t;
  vector<int> n(t.size(), 0);
  vector<int> ans;
  int lastSharpIdx = 0;
  for (int i = 0; i < n.size(); i++) {
    char c = t[i];
    if (c == '(')
      n[i] = 1;
    else if (c == ')')
      n[i] = -1;
    else {
      n[i] = -1;
      lastSharpIdx = i;
      ans.push_back(1);
    }
  }
  n[lastSharpIdx] = 0;
  ans.pop_back();
  int sum = 0;
  for (int i = 0; i < n.size(); i++) {
    sum += n[i];
  }
  if (sum <= 0) {
    cout << -1 << endl;
    return 0;
  }
  n[lastSharpIdx] = -sum;
  ans.push_back(sum);
  sum = 0;
  for (int i = 0; i < n.size(); i++) {
    sum += n[i];
    if (sum < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
