#include <bits/stdc++.h>
using namespace std;
long long n, t, a, k, x;
long long sum = 0;
vector<int> v;
long long A[1 << 20];
int main() {
  v.push_back(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      A[a] += x;
      sum += a * x;
    }
    if (t == 2) {
      cin >> k;
      v.push_back(k);
      sum += k;
    }
    if (t == 3) {
      sum -= v.back();
      sum -= A[v.size()];
      A[v.size() - 1] += A[v.size()];
      A[v.size()] = 0;
      v.pop_back();
    }
    cout << fixed << setprecision(9) << 1.0 * sum / v.size() << endl;
  }
  return 0;
}
