#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int k = 1;
  vector<int> m;
  int u = 0;
  for (int x = 0; x < a.size(); ++x) {
    if (a[x] == '(')
      u++;
    else if (a[x] == ')')
      u--;
    else {
      m.push_back(1);
      if (u == 0) {
        cout << -1;
        k = 0;
        break;
      }
    }
    if (u < 0) {
      cout << -1;
      k = 0;
      break;
    }
  }
  if (k) {
    if (u == 0)
      cout << -1;
    else if (m.size() > u)
      cout << -1;
    else {
      m[m.size() - 1] = u - m.size() + 1;
      u = 0;
      int k = 0;
      for (int x = 0; x < a.size(); ++x) {
        if (a[x] == '(')
          u++;
        else if (a[x] == ')')
          u--;
        else
          u = u - m[k++];
        if (u < 0) {
          cout << -1;
          return 0;
        }
      }
      for (int x = 0; x < m.size(); ++x) cout << m[x] << endl;
    }
  }
}
