#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
long long int a[1000005];
int main() {
  long long int n;
  scanf("%lld", &n);
  v.push_back(0);
  long long int sum = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int tp;
    scanf("%lld", &tp);
    if (tp == 1) {
      long long int ai, xi;
      scanf("%lld%lld", &ai, &xi);
      long long int upd = min((long long int)v.size(), ai);
      sum = sum + upd * xi;
      a[upd] += xi;
    }
    if (tp == 2) {
      long long int k;
      scanf("%lld", &k);
      v.push_back(k);
      sum += k;
    }
    if (tp == 3) {
      long long int idx = (long long int)v.size();
      long long int k = v.back();
      v.pop_back();
      sum -= k;
      sum -= a[idx];
      a[idx - 1] += a[idx];
      a[idx] = 0;
    }
    double avg = sum;
    avg /= (double)v.size();
    printf("%.10f\n", avg);
  }
  return 0;
}
