#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, hash = 0, open = 0, complete = 0;
  char s[100000], ch;
  vector<int> ans;
  while ((ch = getchar()) != '\n') {
    s[i++] = ch;
    if (s[i - 1] == '(') {
      open++;
      complete++;
    } else if (s[i - 1] == ')') {
      open--;
      if (complete > 0)
        complete -= 1;
      else
        complete = 0;
      if (open < 0) {
        printf("-1\n");
        goto vr;
      }
    } else {
      ans.push_back(1);
      hash++;
      open--;
      complete = 0;
      if (open < 0) {
        printf("-1\n");
        goto vr;
      }
    }
  }
  if (open < 0) {
    printf("-1\n");
    goto vr;
  }
  ans[ans.size() - 1] += open;
  if (s[0] == ')' || (complete > 0)) {
    printf("-1\n");
    goto vr;
  }
  for (i = 0; i != ans.size(); i++) cout << ans[i] << "\n";
vr:;
  return 0;
}
