#include <bits/stdc++.h>
using namespace std;
int cnt[212312];
int n;
long long sum = 0;
deque<int> a = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int k, x, y;
    cin >> k;
    if (k == 1) {
      cin >> x >> y;
      cnt[x] += y;
      sum += y * x;
    }
    if (k == 2) {
      cin >> x;
      sum += x;
      a.push_back(x);
    }
    if (k == 3) {
      int len = a.size();
      a.back() += cnt[len];
      sum -= a.back();
      cnt[len - 1] += cnt[len];
      cnt[len] = 0;
      a.pop_back();
    }
    double res = (double)sum / a.size();
    cout << setprecision(10) << res << '\n';
  }
  return 0;
}
