#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> v;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int n = s.length();
  int o = 0, c = 0, h = 0;
  int d = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      d++;
      o++;
    } else if (s[i] == ')') {
      d--;
      c++;
    } else {
      v.push_back(1);
      d--;
    }
    if (d < 0) return cout << -1, 0;
  }
  if (o <= c) return cout << -1, 0;
  int x = v[v.size() - 1];
  v.pop_back();
  v.push_back(x + d);
  int yo = 0;
  o = 0, c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      o++, d++;
    } else if (s[i] == ')') {
      c++, d--;
    } else {
      d -= v[yo];
      yo++;
    }
    if (d < 0) return cout << -1, 0;
  }
  for (auto i : v) cout << i << " ";
  return 0;
}
