#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  int need = 0, hash = 0, last = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      need++;
    } else if (s[i] == ')') {
      need--;
    } else {
      hash++;
      last = i;
    }
  }
  if (need < hash) {
    cout << -1 << endl;
    return 0;
  }
  int open = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      open++;
    } else {
      if (i == last) {
        open -= need - hash + 1;
      } else {
        open--;
      }
      if (open < 0) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  for (int i = 0; i < hash - 1; i++) {
    cout << 1 << endl;
  }
  cout << need - hash + 1;
  return 0;
}
