#include <bits/stdc++.h>
using namespace std;
template <class T>
void pp(T v) {
  for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
    cout << *it << ' ';
  cout << endl;
}
template <class T>
void pp(T v, int n) {
  for (int i = 0; i < (int)n; i++) cout << v[i] << ' ';
  cout << endl;
}
template <class T>
inline void chmax(T &a, const T b) {
  a = max(a, b);
}
template <class T>
inline void chmin(T &a, const T b) {
  a = min(a, b);
}
const int INF = 1 << 28;
const double EPS = 1.0e-9;
static const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int MAX_N = 1 << 18;
int n;
long long dat[2 * MAX_N - 1];
void update(const int from, const int to, const int left, const int right,
            const int idx, const long long v) {
  if (from <= left && to >= right) {
    dat[idx] += v;
    return;
  } else {
    int mid = (left + right) / 2;
    if (from < mid) {
      update(from, to, left, mid, 2 * idx + 1, v);
    }
    if (to > mid) {
      update(from, to, mid, right, 2 * idx + 2, v);
    }
  }
}
void update(const int from, const int to, const long long v) {
  update(from, to, 0, MAX_N, 0, v);
}
long long get(const int pos) {
  long long ans = 0;
  int idx = pos + MAX_N - 1;
  while (true) {
    ans += dat[idx];
    if (idx == 0) break;
    idx = (idx - 1) / 2;
  }
  return ans;
}
int main(void) {
  memset(dat, 0, sizeof(dat));
  double ans = 0.0;
  int len = 1;
  int N;
  scanf("%d", &N);
  while (--N >= 0) {
    int a, x, k;
    int t;
    scanf("%d", &t);
    switch (t) {
      case 1:
        scanf("%d %d", &a, &x);
        update(0, a, x);
        ans += (double)a * x;
        break;
      case 2:
        scanf("%d", &k);
        update(len, len + 1, k);
        ans += k;
        len++;
        break;
      case 3:
        if (len >= 1) {
          long long v = get(len - 1);
          ans -= (double)v;
          update(len - 1, len, -v);
          len--;
        }
        break;
    }
    printf("%0.8f", ans / (double)len);
    puts("");
  }
  return 0;
}
