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