#include <bits/stdc++.h>
using namespace std;
long long s, m = 1;
long long n, t, a, b, ind = 1;
long long mas[500000];
long long pref[500000];
int main() {
  cin >> n;
  cout << fixed << setprecision(10);
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t == 1) {
      cin >> a >> b;
      pref[a - 1] += b;
      s += a * b;
    } else if (t == 2) {
      cin >> a;
      mas[ind] = a;
      ind++;
      s += a;
      m++;
    } else {
      ind--;
      s -= (mas[ind] + pref[ind]);
      if (ind > 0) {
        pref[ind - 1] += pref[ind];
      }
      pref[ind] = 0;
      m--;
    }
    cout << (long double)s / m << "\n";
  }
  return 0;
}
