#include<bits/stdc++.h>

using namespace std;

#define REP(i,n) for(ll (i) = 0;(i) < (n);i++)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) b.begin(),v.end()
#define SHOW1d(v, n) {REP(WW,n)cerr<<v[WW]<<" ";cerr<<endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr<<v[W_][H_]<<" ";cerr<<endl;}cerr<<endl;}
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll, ll> P;

ll dp[222222];
ll mp[222222];
char c[222222];
vector<vector<ll>> v(4444444);

void mod_add(ll &a, ll b){
  a += b;
  //a %= MOD;
}

void v_push(ll i, ll a){
  v[i+222222].PB(a);
}

void v_pop(int i){
  v[i+222222].pop_back();
}

ll v_get(int i){
  return v[i+222222].back();
}

ll v_size(int i){
  return v[i+222222].size();
}

ll cal_func(int pla, int high){
  //cout << "cal_func " << pla << " " << high << endl;
  if(v_size(high) == 0)return dp[pla] = 0;
  ll ret = 1;
  ll tmp = v_get(high);
  //cout << "cal_func " << tmp << endl;
  if(tmp > 0 && c[tmp - 1] == ')')mod_add(ret, dp[tmp-1]);
  return dp[pla] = ret;
}

int main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

  string str;cin >> str;
  ll now_high = 0;
  ll length = 0;
  ll ans = 0;
  REP(i, str.size()){
    if(str[i] == '('){
      v_push(now_high, length);
      c[length] = '(';
      now_high++;

      length++;
    }
    else if(str[i] == ')'){
      now_high--;
      c[length] = ')';
      mod_add(ans, cal_func(length, now_high));

      length++;
    }
    else {
      length--;
      if(c[length] == ')'){
        now_high++;
        mod_add(ans, -dp[length]);
      }
      else{
        now_high--;
        v_pop(now_high);
      }
      c[length] = ' ';
      dp[length] = 0;
    }

    cout << ans << "\n";
    //SHOW1d(dp, 10);
    //SHOW1d(c, 20);
  }

  return 0;
}

