#include <bits/stdc++.h>
using namespace std;
using ld = long double;
const int N = 2e5 + 10;
int n, a[N], add[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(9);
  cin >> n;
  int sz = 1;
  long long sum = 0;
  int ti, ai, xi, ki;
  for (int i = 0; i < n; i++) {
    cin >> ti;
    if (ti == 1) {
      cin >> ai >> xi;
      sum += 1LL * ai * xi;
      add[ai] += xi;
    }
    if (ti == 2) {
      cin >> ki;
      sz++;
      a[sz] = ki;
      sum += 1LL * ki;
    }
    if (ti == 3) {
      sum -= (long long)(a[sz] + add[sz]);
      add[sz - 1] += add[sz];
      add[sz] = 0;
      sz--;
    }
    cout << (ld)sum / sz << '\n';
  }
  return 0;
}
