#include <bits/stdc++.h>
using namespace std;
int A[200005];
long long v[200005];
int main() {
  int op, x, a, n;
  for (int i = 0; i <= 200005 + 2; i++) v[i] = 0;
  while (scanf("%d", &op) == 1) {
    n = 1;
    A[1] = 0;
    long long S = 0;
    int t;
    while (op--) {
      scanf("%d", &t);
      if (t == 1) {
        scanf("%d", &x), scanf("%d", &a);
        x = min(x, n);
        v[x] += a;
        S += a * x;
      } else if (t == 2) {
        scanf("%d", &x);
        n++;
        S += x;
        A[n] = x;
      } else {
        if (v[n] != 0) {
          S -= v[n];
          S -= A[n];
          v[n - 1] += v[n];
          v[n] = 0;
          A[n] = 0;
          n--;
        } else {
          S -= A[n];
          A[n] = 0;
          n--;
        }
      }
      printf("%.8lf\n", (1.0 * S) / n);
    }
  }
}
