#include <bits/stdc++.h>
using namespace std;
char c[100005];
int f[100005], len, fi;
void check() {
  int now = 0, j = 0;
  for (int i = 0; i < len; ++i) {
    if (c[i] == '(')
      now++;
    else if (c[i] == ')')
      now--;
    else
      now -= f[++j];
    if (now < 0) {
      puts("-1");
      return;
    }
  }
  for (int i = 1; i <= j; ++i) {
    printf("%d\n", f[i]);
  }
}
int main() {
  while (~scanf("%s", c)) {
    len = strlen(c);
    memset(f, -1, sizeof(f));
    int now = 0, j = 0;
    fi = 0;
    for (int i = 0; i < len; ++i) {
      if (c[i] == '(')
        now++;
      else if (c[i] == ')')
        now--;
      else {
        f[++fi] = 1;
        now--;
      }
    }
    if (now > 0) f[fi] += now;
    check();
  }
  return 0;
}
