#include <bits/stdc++.h>
using namespace std;
int n, x, k, idx, j = 1;
double sum = 0;
vector<int> a, b;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  a.push_back(0);
  b.push_back(0);
  while (n--) {
    cin >> k;
    if (k == 1) {
      cin >> idx >> x;
      sum += idx * x;
      b[idx - 1] += x;
    }
    if (k == 2) {
      cin >> x;
      sum += x;
      b.push_back(0);
      a.push_back(x);
    }
    if (k == 3) {
      sum -= (a[a.size() - 1] + b[b.size() - 1]);
      b[b.size() - 2] += b[b.size() - 1];
      b.pop_back();
      a.pop_back();
    }
    cout << setprecision(10) << fixed << sum / b.size() << endl;
  }
  return 0;
}
