#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int counter = 0;
  int num = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '(') {
      counter++;
    } else if (s[i] == ')') {
      counter--;
    } else {
      num++;
    }
  }
  int arr[num];
  for (int i = 0; i < num - 1; i++) {
    arr[i] = 1;
    counter--;
  }
  if (num >= 1) {
    arr[num - 1] = counter;
  }
  counter = 0;
  num = 0;
  bool flag = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '(') {
      counter++;
    } else if (s[i] == ')') {
      counter--;
    } else {
      if (arr[num] <= 0) flag = true;
      counter -= arr[num];
      num++;
    }
    if (counter < 0) {
      flag = true;
    }
  }
  if (flag == true || counter != 0) {
    cout << "-1" << endl;
  } else {
    for (int i = 0; i < num; i++) {
      cout << arr[i] << endl;
    }
  }
  return 0;
}
