#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  double sum = 0;
  int n = 1;
  long long int add[200005];
  vector<double> v;
  v.push_back(0);
  while (t--) {
    int op;
    cin >> op;
    if (op == 1) {
      int a, x;
      cin >> a >> x;
      sum += a * x;
      add[a - 1] += x;
    } else if (op == 2) {
      double k;
      cin >> k;
      v.push_back(k);
      sum += k;
      n++;
    } else {
      double val = v[v.size() - 1];
      val += add[v.size() - 1];
      add[v.size() - 2] += add[v.size() - 1];
      add[v.size() - 1] = 0;
      sum -= val;
      v.pop_back();
      n--;
    }
    double ans = sum / n;
    cout << fixed << setprecision(6) << ans << "\n";
  }
  return 0;
}
