#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr;
  arr.push_back(0);
  long long last = 0, sum = 0;
  double a = 0.;
  int size = 1;
  vector<int> add(n + 1, 0);
  for (int i = 0; i < n; ++i) {
    int type;
    cin >> type;
    if (type == 1) {
      int xi;
      int ai;
      cin >> ai >> xi;
      sum += ai * xi;
      add[ai - 1] += xi;
    } else if (type == 2) {
      int ki;
      cin >> ki;
      arr.push_back(ki);
      size += 1;
      sum += ki;
    } else {
      if (arr.size() >= 2) add[arr.size() - 2] += add[arr.size() - 1];
      sum -= add[arr.size() - 1] + arr[arr.size() - 1];
      add[arr.size() - 1] = 0;
      arr.pop_back();
      size -= 1;
    }
    a = (double)sum / (double)size;
    printf("%.8lf\n", a);
  }
}
