#include <bits/stdc++.h>
using namespace std;
int length, n, t, idx, x, k, a[200000 + 5], add[200000 + 5];
double solution, sum;
int main() {
  scanf("%d", &n);
  length++;
  a[length] = 0;
  for (int j = 0; j < n; j++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d %d", &idx, &x);
      add[idx] += x;
      sum += double(x) * double(idx);
    }
    if (t == 2) {
      scanf("%d", &k);
      length++;
      a[length] = k;
      sum += double(k);
    }
    if (t == 3) {
      sum -= a[length] + add[length];
      add[length - 1] += add[length];
      add[length] = 0;
      length--;
    }
    if (length > 0)
      solution = sum / double(length);
    else
      solution = 0.;
    printf("%.12lf\n", solution);
  }
  return 0;
}
