#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long maxn = 200005;
long long cnt[maxn];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, t, a, x;
  cin >> n;
  double sumi = 0.0, av = 0.0;
  vector<long long> cur;
  cur.push_back(0);
  long long ele = 1;
  while (n--) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      cnt[a] += x;
      sumi += (a * x);
      av = (double)sumi / ele;
    } else if (t == 2) {
      cin >> x;
      cur.push_back(x);
      ele++;
      sumi += x;
      av = (double)sumi / ele;
    } else {
      cnt[ele - 1] += cnt[ele];
      sumi -= cnt[ele];
      sumi -= (cur.back());
      cnt[ele] = 0;
      cur.pop_back();
      ele--;
      av = (double)sumi / ele;
    }
    cout << setprecision(18) << fixed << av << "\n";
  }
  return 0;
}
