#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int siz, h = 0, x1 = 0, x2 = 0;
  string s;
  cin >> s;
  siz = s.size();
  for (int i = 0; i < siz; ++i) {
    if (s[i] == '(')
      ++x1, ++x2;
    else if (s[i] == ')')
      --x1, x2 = (((x2 - 1) >= 0) ? (x2 - 1) : 0);
    else
      ++h, --x1, x2 = 0;
    if (x1 < 0) {
      cout << -1;
      return 0;
    }
  }
  if (x2 > 0) {
    cout << -1;
    return 0;
  }
  --h;
  for (int i = 0; i < h; ++i) cout << 1 << '\n';
  cout << 1 + x1;
  return 0;
}
