#include <bits/stdc++.h>
using namespace std;
long long a[500005];
long long add[500005];
int main() {
  int i, j, n, x, y, z, m;
  long long sum;
  scanf("%d", &n);
  sum = 0;
  a[0] = 0;
  m = 1;
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d%d", &y, &z);
      sum += y * z;
      add[y - 1] += z;
      printf("%lf\n", sum * 1.0 / m);
    }
    if (x == 2) {
      scanf("%d", &y);
      a[m++] = y;
      add[m - 1] = 0;
      sum += y;
      printf("%lf\n", sum * 1.0 / m);
    }
    if (x == 3) {
      sum -= a[m - 1];
      sum -= add[m - 1];
      a[m - 1] = 0;
      add[m - 2] += add[m - 1];
      add[m - 1] = 0;
      m--;
      printf("%lf\n", sum * 1.0 / m);
    }
  }
  return 0;
}
