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