#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string inputString;
  cin >> inputString;
  int leftCounter = 0, rightCounter = 0, hashCounter = 0;
  for (char symbol : inputString) {
    if (symbol == '(') {
      ++leftCounter;
    } else if (symbol == ')') {
      ++rightCounter;
    } else {
      ++hashCounter;
    }
  }
  if (leftCounter < rightCounter + hashCounter) {
    cout << "-1\n";
    return 0;
  }
  int nestingDepth = 0, replaced = 0;
  vector<int> answer;
  for (char symbol : inputString) {
    if (symbol == '(') {
      ++nestingDepth;
    } else if (symbol == ')') {
      if (--nestingDepth < 0) {
        cout << "-1\n";
        return 0;
      }
    } else {
      int replace = 1;
      if (++replaced == hashCounter) {
        replace += leftCounter - rightCounter - hashCounter;
      }
      if ((nestingDepth -= replace) < 0) {
        cout << "-1\n";
        return 0;
      }
      answer.push_back(replace);
    }
  }
  for (int replace : answer) {
    cout << replace << '\n';
  }
  return 0;
}
