#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  vector<int> ans;
  int crt = 0, cnt = 0;
  for (int i = 0; i < l; i++) {
    if (s[i] == '(') {
      crt++;
    } else if (s[i] == ')') {
      crt--;
    } else {
      cnt++;
    }
  }
  if (crt < cnt) {
    cout << -1;
    return 0;
  }
  while (cnt > 1) {
    ans.push_back(1);
    cnt--;
    crt--;
  }
  ans.push_back(crt);
  crt = 0;
  int j = 0;
  for (int i = 0; i < l; i++) {
    if (crt < 0) {
      cout << -1;
      return 0;
    }
    if (s[i] == '(') {
      crt++;
    } else if (s[i] == ')') {
      crt--;
    } else {
      crt -= ans[j];
      j++;
    }
  }
  if (crt) {
    cout << -1;
  } else {
    for (int i : ans) {
      cout << i << '\n';
    }
  }
  return 0;
}
