#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 1000 * 100 + 10;
int cnt[MAXN], a[MAXN];
long double ans;
int main() {
  int n, size = 1, t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t == 1) {
      int x, y;
      cin >> x >> y;
      cnt[min(size, x)] += y;
      ans = (ans * size + min(size, x) * y) / size;
    } else if (t == 2) {
      int x;
      cin >> x;
      ans = (ans * size + x) / (size + 1);
      size++;
      a[size] = x;
    } else {
      ans = (ans * size - a[size] - cnt[size]) / (size - 1);
      size--;
      cnt[size] += cnt[size + 1];
      cnt[size + 1] = 0;
    }
    cout << setprecision(9) << fixed << ans << endl;
  }
  return 0;
}
