#include <bits/stdc++.h>
using namespace std;
int i, j, k, l, n, m, q[240000], sign[240000], r, type, x, y;
long long sum;
int main() {
  scanf("%d", &n);
  sum = 0;
  q[r = 1] = 0;
  for (i = 1; i <= n; ++i) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d", &x, &y);
      sum += x * y;
      sign[x] += y;
    } else if (type == 2) {
      scanf("%d", &x);
      q[++r] = x;
      sum += x;
    } else {
      sum -= sign[r] + q[r];
      sign[r - 1] += sign[r];
      sign[r] = 0;
      r--;
    }
    printf("%.6lf\n", (double)sum / r);
  }
}
