#include <bits/stdc++.h>
using namespace std;
double a[200002] = {0}, b[200002] = {0};
int main() {
  int n, t, cnt = 1, ab;
  scanf("%d", &n);
  double avg = 0.000, x, k;
  a[1] = 0.000;
  while (n--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%lf", &ab, &x);
      b[ab] += (double)x;
      avg = (double)(avg * cnt + ab * x) / cnt;
    } else if (t == 2) {
      scanf("%lf", &k);
      cnt++;
      a[cnt] = (double)k;
      avg = (double)(avg * (cnt - 1) + k) / cnt;
    } else {
      b[cnt - 1] += b[cnt];
      avg = (double)(avg * cnt - (a[cnt] + b[cnt])) / (cnt - 1);
      b[cnt] = 0.000;
      cnt--;
    }
    printf("%.6lf\n", avg);
  }
  return 0;
}
