#include <bits/stdc++.h>
using namespace std;
long long a, s, d[200002], f[200003], g = 1, h, j, k, l, i, n, m;
int main() {
  cin >> n;
  g = 1;
  h = 0;
  for (i = 0; i < n; i++) {
    cin >> a;
    if (a == 1) {
      cin >> k >> l;
      d[k] = d[k] + l;
      h = h + k * l;
    }
    if (a == 2) {
      cin >> k;
      h = h + k;
      g++;
      f[g] = f[g] + k;
      d[g] = d[g] + k;
    }
    if (a == 3) {
      d[g - 1] = d[g - 1] + d[g] - f[g];
      h = h - d[g];
      d[g] = 0;
      f[g] = 0;
      g--;
    }
    printf("%.7f\n", (double)h / g);
  }
}
