#include <bits/stdc++.h>
using namespace std;
int a[123456];
int aa[123456];
int ans[123456];
int main() {
  string s;
  cin >> s;
  int b, c;
  b = c = 0;
  int t = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(')
      b++;
    else if (s[i] == ')')
      b--;
    else {
      b--;
      ans[++t] = 1;
    }
    if (b < 0) {
      cout << -1;
      return 0;
    }
  }
  ans[t] = b + 1;
  int k = 0;
  b = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(')
      b++;
    else if (s[i] == ')')
      b--;
    else {
      b -= ans[++k];
    }
    if (b < 0) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= t; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
