#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  long long cnto = 0, cntc = 0, cnth = 0, cntb = 0, cnt = 0;
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      cnto++;
      cntb++;
    } else if (s[i] == ')') {
      cntc++;
      if (cntc > cnto) {
        cout << -1 << endl;
        return 0;
      }
      if (cntb > 0) cntb--;
    } else {
      cnt++;
      cntb = 0;
      if (cntc + cnt > cnto) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  if (cntc >= cnto || cntb > 0) {
    cout << -1 << endl;
    return 0;
  }
  for (long long i = 1; i < cnt; i++) cout << 1 << endl;
  cout << (cnto - cntc) - cnt + 1 << endl;
  return 0;
}
