#include <bits/stdc++.h>
using namespace std;
long long n, tp, q, s;
vector<long long> v;
long long add, p, dv[500000], upd[50000];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  v.push_back(0);
  for (int i = 1; i <= n; i++) {
    cin >> tp;
    if (tp == 2) {
      cin >> q;
      v.push_back(q);
      s += q;
    }
    if (tp == 1) {
      cin >> q;
      cin >> add;
      s += q * add;
      upd[q] += add;
    }
    if (tp == 3) {
      p = v.size();
      dv[p - 1] += dv[p] + upd[p];
      q = v[v.size() - 1];
      q += dv[p];
      q += upd[p];
      s -= q;
      dv[p] = upd[p] = 0;
      v.pop_back();
    }
    cout.precision(8);
    cout << fixed << s * 1.0 / v.size() << endl;
  }
  cin.get();
  cin.get();
  return 0;
}
