#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 15;
const long long int inf = 1e18;
void solve() {
  long long int q;
  cin >> q;
  long long int sz = 1;
  long long int sum = 0;
  vector<long long int> add(N);
  vector<long long int> val(N);
  while (q--) {
    long long int type;
    cin >> type;
    if (type == 1) {
      long long int a, x;
      cin >> a >> x;
      add[a - 1] += x;
      sum += a * x;
    } else if (type == 2) {
      long long int x;
      cin >> x;
      val[sz] = x;
      sz++;
      sum += x;
    } else {
      long long int x = val[sz - 1] + add[sz - 1];
      add[sz - 2] += add[sz - 1];
      add[sz - 1] = 0;
      sum -= x;
      sz--;
    }
    cout << setprecision(12) << fixed << sum * 1.0 / sz << "\n";
  }
}
void debug(long long int tt) {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
