#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  string s;
  cin >> s;
  vector<int> v;
  int len, op, cls;
  len = s.length();
  int arr[len];
  bool done[len];
  fill(done, done + len, false);
  cls = 0;
  op = 0;
  for (i = 0; i < len; i++) {
    if (s[i] == '(') {
      cls++;
      arr[i] = 1;
    } else if (s[i] == ')') {
      arr[i] = 1;
      op++;
    } else {
      arr[i] = 0;
      v.push_back(i);
      done[i] = true;
      s[i] = ')';
    }
  }
  cls = cls - op;
  cls = max(0, cls);
  for (i = 0; i < v.size() - 1; i++) {
    if (cls == 0) {
      cout << -1;
      return 0;
    } else {
      arr[v[i]] = 1;
    }
    cls--;
    cls = max(cls, 0);
  }
  if (cls == 0) {
    cout << -1;
    return 0;
  }
  arr[v.back()] = max(0, cls);
  cls = 0;
  op = 0;
  for (i = 0; i < len; i++) {
    if (s[i] == '(') {
      cls += arr[i];
    } else {
      op += arr[i];
    }
    if (op > cls) {
      cout << -1;
      return 0;
    }
  }
  if (op != cls) {
    cout << -1;
    return 0;
  }
  for (i = 0; i < len; i++) {
    if (done[i]) {
      cout << arr[i] << endl;
    }
  }
  return 0;
}
