#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int> > opers;
int a[200010];
int main() {
  int n;
  int m = 1;
  cin >> n;
  long long sum = 0;
  long long sum2 = 0;
  cout.precision(9);
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, a;
      cin >> a >> x;
      opers.push(pair<int, int>(a, x));
      sum += a * x;
    } else if (t == 2) {
      int x;
      cin >> x;
      sum += x;
      opers.push(pair<int, int>(m, sum2));
      sum2 = 0;
      a[m++] = x;
    } else
      sum -= sum2 + a[--m];
    while (!opers.empty() && opers.top().first >= m) {
      sum2 += opers.top().second;
      opers.pop();
    }
    cout << fixed << (double)sum / m << endl;
  }
}
