#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tc = 1;
  while (tc--) {
    vector<float> a{0};
    vector<float> ad{0};
    double n, sum = 0;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      long long ch;
      cin >> ch;
      if (ch == 2) {
        double x;
        cin >> x;
        a.push_back(x);
        ad.push_back(0);
        sum += x;
      } else if (ch == 1) {
        double num, ele;
        cin >> num >> ele;
        ad[num - 1] += ele;
        sum += num * ele;
      } else {
        sum -= (a.back() + ad.back());
        long long n = ad.size();
        ad[n - 2] += ad[n - 1];
        ad.pop_back();
        a.pop_back();
      }
      float sz = ad.size();
      cout << setprecision(10) << sum / sz << "\n";
    }
  }
  return 0;
}
