#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
long long a[1000100], b[1000100];
signed main() {
  long long n;
  cin >> n;
  long long ki, ai, xi;
  long long sum = 0, len = 1;
  long double avg = 0.0;
  long long type;
  for (long long i = 0; i < n; i++) {
    cin >> type;
    if (type == 1) {
      cin >> ai >> xi;
      b[min(ai, len)] += xi;
      sum += ai * xi;
    } else if (type == 2) {
      cin >> ki;
      a[++len] = ki;
      sum += ki;
    } else {
      sum -= a[len] + b[len];
      b[len - 1] += b[len];
      b[len] = 0;
      --len;
    }
    avg = (1. * sum / len);
    cout << fixed << setprecision(8) << avg << '\n';
  }
}
