#include <bits/stdc++.h>
using namespace std;
long long n, m;
const long long N = 2e5 + 100;
struct BIT {
  long long sum[N];
  void add(long long x, long long v) {
    while (x <= m + 1) sum[x] += v, x += x & (-x);
  }
  long long gsum(long long x) {
    long long s = 0;
    while (x) s += sum[x], x -= x & (-x);
    return s;
  }
};
struct BIT_per {
  BIT bit0, bit1;
  void add(long long l, long long r, long long val) {
    bit0.add(l, -(l - 1) * val);
    bit0.add(r + 1, r * val);
    bit1.add(l, val);
    bit1.add(r + 1, -val);
  }
  long long gsum(long long l, long long r) {
    long long res = 0;
    res -= bit0.gsum(l - 1) + bit1.gsum(l - 1) * (l - 1);
    res += bit0.gsum(r) + bit1.gsum(r) * r;
    return res;
  }
};
BIT_per bit;
signed main() {
  cin >> m;
  n = 1;
  for (long long i = 1; i <= m; i++) {
    long long t;
    cin >> t;
    if (t == 1) {
      long long x, y;
      cin >> x >> y;
      bit.add(1, x, y);
    } else if (t == 2) {
      long long x;
      cin >> x;
      n++;
      bit.add(n, n, x);
    } else {
      bit.add(n, n, -bit.gsum(n, n));
      n--;
    }
    printf("%.7lf\n", 1.0 * bit.gsum(1, n) / (n * 1.0));
  }
  return 0;
}
