#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<int> rangeTracker(200001, 0), pointTracker(200001, 0);
  long long size = 1;
  long long runningSum = 0;
  while (n--) {
    long long q;
    cin >> q;
    if (q == 1) {
      long long x, a;
      cin >> a >> x;
      runningSum += x * a;
      rangeTracker[a] += x;
      size = max(size, a);
    }
    if (q == 2) {
      long long x;
      cin >> x;
      size++;
      pointTracker[size] = x;
      runningSum += x;
    }
    if (q == 3) {
      size--;
      rangeTracker[size] += rangeTracker[size + 1];
      runningSum -= rangeTracker[size + 1] + pointTracker[size + 1];
      rangeTracker[size + 1] = 0;
    }
    double avg = runningSum / ((double)size);
    cout << fixed << setprecision(7) << avg << endl;
  }
}
