#include <bits/stdc++.h>
using namespace std;
long q[200008][2];
int main() {
  int i, j, a, x;
  long long sum = 0;
  int s = 1;
  int n, t;
  double ans = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      sum += (a * x);
      q[a][1] += x;
    }
    if (t == 2) {
      cin >> a;
      sum += a;
      s++;
      q[s][0] = q[s][1] = a;
    }
    if (t == 3) {
      sum -= q[s][1];
      s--;
      q[s][1] += (q[s + 1][1] - q[s + 1][0]);
    }
    ans = sum;
    printf("%f\n", ans / s);
  }
  return 0;
}
