#include <bits/stdc++.h>
using namespace std;
int cond = 0;
int extra[200003];
int main() {
  int n, t;
  cin >> n;
  double mid = 0.00, sum = 0.00;
  int a, x;
  vector<int> v;
  v.push_back(0);
  for (int i = 0; i < n; ++i) {
    cin >> t;
    switch (t) {
      case 1: {
        cin >> a >> x;
        extra[a] += x;
        sum += x * a;
        {
          if (cond) {
            cerr << "Line:" << 27 << ", "
                 << "a"
                 << " = " << a << endl;
          }
        };
        {
          if (cond) {
            cerr << "Line:" << 28 << ", "
                 << "x"
                 << " = " << x << endl;
          }
        };
        {
          if (cond) {
            cerr << "Line:" << 29 << ", "
                 << "extra[a]"
                 << " = " << extra[a] << endl;
          }
        };
        break;
      }
      case 2: {
        int k;
        cin >> k;
        v.push_back(k);
        extra[v.size()] = 0;
        sum += k;
        break;
      }
      case 3: {
        int num = v.size();
        {
          if (cond) {
            cerr << "Line:" << 42 << ", "
                 << "num"
                 << " = " << num << endl;
          }
        };
        {
          if (cond) {
            cerr << "Line:" << 43 << ", "
                 << "extra[num]"
                 << " = " << extra[num] << endl;
          }
        };
        {
          if (cond) {
            cerr << "Line:" << 44 << ", "
                 << "sum"
                 << " = " << sum << endl;
          }
        };
        sum -= extra[num];
        extra[num - 1] += extra[num];
        sum -= v.back();
        v.pop_back();
        break;
      }
      default:
        break;
    }
    mid = sum / v.size();
    printf("%.6f\n", mid);
  }
  return 0;
}
