#include <bits/stdc++.h>
using namespace std;
int main() {
  int d[200000 + 200], a[200000 + 200];
  int n;
  while (scanf("%d", &n) != EOF) {
    int num = 1;
    for (int i = 0; i < 200000 + 200; i++) {
      d[i] = 0;
      a[i] = 0;
    }
    double sum = 0;
    for (int i = 0; i < n; i++) {
      int op;
      scanf("%d", &op);
      if (op == 1) {
        int a, x;
        scanf("%d%d", &a, &x);
        d[a] += x;
        sum += a * x;
      } else if (op == 2) {
        int x;
        scanf("%d", &x);
        num++;
        a[num] = x;
        sum += x;
      } else if (op == 3) {
        d[num - 1] += d[num];
        sum -= a[num] + d[num];
        a[num] = d[num] = 0;
        num--;
      }
      printf("%lf\n", sum / num);
    }
  }
}
