#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return b / gcd(a, b) * a; }
string x;
int a, b, c;
vector<int> p;
int g[1 << 20];
int main() {
  cin >> x;
  for (int(i) = 0; i < int(x.size()); ++i) {
    if (x[i] == '(') {
      ++a;
      g[i] = 1;
    } else if (x[i] == ')') {
      ++b;
      g[i] = -1;
    } else {
      if (b + 1 > a) {
        puts("-1");
        return 0;
      }
      p.push_back(i);
      ++b;
      g[i] = -1;
    }
  }
  int n = p.size();
  g[p[n - 1]] = -(a - b + 1);
  int s = 0, ss = 0;
  for (int(i) = 0; i < int(x.size()); ++i) {
    s += g[i];
    if (s < 0 || g[i] == 0) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 0; i < n - 1; ++i) cout << 1 << endl;
  cout << a - b + 1 << endl;
  cin >> n;
}
