#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
long long a[N], f[N];
int main() {
  long long o, t, n = 1;
  long long s = 0;
  scanf("%I64d", &o);
  while (o--) {
    scanf("%I64d", &t);
    if (t == 2) {
      n++;
      scanf("%I64d", &a[n]);
      f[n] = 0;
      s += a[n];
    } else if (t == 1) {
      long long cnt, x;
      scanf("%I64d%I64d", &cnt, &x);
      f[cnt] += x;
      s += cnt * x;
    } else if (t == 3) {
      s -= (f[n] + a[n]);
      f[n - 1] += f[n];
      f[n] = 0;
      n--;
    }
    printf("%.9lf\n", s * 1.0 / n);
  }
}
