#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double s;
  vector<int> v(1);
  int ad[200000];
  while (n--) {
    int t;
    cin >> t;
    if (t == 1) {
      int a, x;
      cin >> a >> x;
      s += a * x;
      ad[a - 1] += x;
    } else if (t == 2) {
      int k;
      cin >> k;
      v.push_back(k);
      s += k;
    } else {
      s -= ad[v.size() - 1] + v.back();
      ad[v.size() - 2] += ad[v.size() - 1];
      ad[v.size() - 1] = 0;
      v.pop_back();
    }
    cout << fixed << s / v.size() << endl;
  }
  return 0;
}
