#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long c) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b & 1) x = (x * y) % c;
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
int dx[] = {0, -1, 0, 1};
int dy[] = {-1, 0, 1, 0};
int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  string s;
  cin >> s;
  int n = s.size(), cnt = 0, h = 0;
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '(')
      cnt++;
    else if (s[i] == ')')
      cnt--;
    else {
      cnt--;
      ans.push_back(1);
    }
    if (cnt < 0) {
      printf("-1\n");
      return 0;
    }
  }
  ans.back() += cnt;
  int ptr = 0;
  cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '(')
      cnt++;
    else if (s[i] == ')')
      cnt--;
    else
      cnt -= ans[ptr++];
    if (cnt < 0) {
      printf("-1\n");
      return 0;
    }
  }
  if (cnt > 0) {
    printf("-1\n");
    return 0;
  }
  for (auto u : ans) printf("%d\n", u);
  return 0;
}
