#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, x;
  double a[2 * 100000 + 10] = {0};
  double b[2 * 100000 + 10] = {0};
  scanf("%d", &n);
  int y, size = 1;
  double sum = 0, z;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d%lf", &y, &z);
      sum += y * z;
      y--;
      a[y] += z;
    } else if (x == 2) {
      scanf("%lf", &z);
      sum += z;
      b[size] = z;
      a[size] = 0;
      size++;
    } else {
      sum -= b[size - 1];
      sum -= a[size - 1];
      a[size - 2] += a[size - 1];
      a[size - 1] = 0;
      b[size - 1] = 0;
      size--;
    }
    printf("%0.10f\n", ((double)sum / (double)size));
  }
}
