#include <bits/stdc++.h>
using namespace std;
int val[200007], add[200007];
int main() {
  int n, t, a, x, k, l = 1;
  long long sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", &a, &x);
      add[a] += x;
      sum += a * x;
    } else if (t == 2) {
      scanf("%d", &k);
      val[++l] = k;
      sum += val[l];
    } else if (l > 1) {
      sum -= val[l];
      sum -= add[l];
      add[l - 1] += add[l];
      add[l] = 0;
      --l;
    }
    printf("%.6lf\n", (double)sum / l);
  }
  return 0;
}
