#include <bits/stdc++.h>
int i, t, D[48], C[48];
char *p, *c, *last, *r, s[3000016];
int main() {
  memcpy(r = p = s + 300000, "%d\n\0-1\n", 8);
  for (c = gets(s); *c; C[*c++]++)
    if (*c == '#') last = c, *--r = '\n', *--r = '1';
  *last = '*';
  D['('] = -1;
  D[')'] = D['#'] = 1;
  t = C['('] - C[')'] - C['#'] + 1;
  D['*'] = t = t < 1 ? 1 : t;
  for (c = s; *c; c++)
    if ((i += D[*c]) > 0) r = p + 2;
  printf(r + 2, t);
}
