#include <bits/stdc++.h>
using namespace std;
long long n, cnt = 1, ans, a[200005], b[200005];
signed main() {
  cin >> n;
  while (n--) {
    long long c, x, y;
    cin >> c;
    if (c == 1) {
      cin >> x >> y;
      a[x] += y;
      ans += x * y;
    }
    if (c == 2) {
      cin >> x;
      b[++cnt] = x;
      ans += x;
    }
    if (c == 3) {
      a[cnt - 1] += a[cnt];
      ans -= a[cnt];
      a[cnt] = 0;
      ans -= b[cnt];
      b[cnt] = 0;
      cnt--;
    }
    printf("%.6lf\n", ans * 1.0 / cnt);
  }
  return 0;
}
