#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
long b[200005];
int main() {
  long m, n, i, t, x, a;
  double s = 0.0;
  cin >> m;
  n = 2;
  for (i = 0; i < m; i++) {
    cin >> t;
    if (t == 1) {
      cin >> x >> a;
      s = s + x * a;
      b[x] += a;
    } else if (t == 2) {
      cin >> x;
      s += x;
      b[n] = x;
      b[n - 1] -= x;
      n++;
    } else if (n > 2) {
      s -= b[n - 1];
      b[n - 2] += b[n - 1];
      b[n - 1] = 0;
      n--;
    }
    double v = s / (double)(n - 1);
    printf("%lf\n", v);
  }
  return 0;
}
