#(#(#((##((()))(((#)(#()#(((()()(()#(##(((()(((()))#(((((()(((((((()#((#((()(#(((()(()##(()(((()((#(
 (#((((()
 (#((
 ((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((##
 (())((((#)
 (#(
 (#))(#(#)((((#(##((#(#((((#(##((((((#((()(()(())((()#((((#((()((((#(((((#(##)(##()((((()())(((((#(((
 ##((((((()
 #((#
 #))))
 (((((#(#(#(#()
 ((#(()#(##
 (((((((((((((((((((###################
 )((##((###
 (((()#(#)(
 ((#)(
 )(((())#
 ()((#((#(#()
 ((#(
 ()#(#())()()#)(#)()##)#((()#)((#)()#())((#((((((((#)()()(()()(((((#)#(#((((#((##()(##(((#(()(#((#))#

-1
 -1
 -1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 3
 -1
 -1
 -1
 -1
 -1
 1
1
1
5
 1
1
1
1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 -1
 -1
 -1
 -1
 1
1
3
 -1
 -1

#include <bits/stdc++.h>
using namespace std;
inline int Get() {
  int res = 0, q = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * q;
}
const double eps = 1e-12, pi = M_PI;
const int oo = (int)2e9, mod = (int)1e9 + 7;
const long long INF = (long long)1e17;
const int N = (int)1e5;
char s[N + 10];
int n, m;
int a[N + 10], x[N + 10];
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = (1), end = (n); i <= end; ++i) a[i] = oo;
  int cur = 0;
  for (int i = (1), end = (n); i <= end; ++i) {
    if (s[i] == '(')
      ++cur;
    else if (s[i] == ')')
      --cur;
    else
      ++m;
    a[m] = min(a[m], cur);
    if (cur < 0) return printf("-1\n"), 0;
  }
  int st = 0;
  for (int i = (1), end = (m); i <= end; ++i) {
    if (a[i] <= a[i - 1])
      return printf("-1\n"), 0;
    else
      x[i] = a[i] - a[i - 1];
    st += x[i];
  }
  if (st != cur)
    printf("-1\n");
  else
    for (int i = (1), end = (m); i <= end; ++i)
      printf(
          "%d"
          "\n",
          x[i]);
  return 0;
}
