#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const int INF = 1e9 + 10;
const long long LINF = 1000ll * 1000 * 1000 * 1000 * 1000 * 1000 + 100;
const long double EPS = 1e-12;
const int MN = 2e5 + 10;
int n;
long long cur;
long long add[MN], arr[MN];
int sz = 1;
int main() {
  scanf("%d", &n);
  int tp, x, k;
  while (n--) {
    scanf("%d", &tp);
    if (tp == 1) {
      scanf("%d%d", &x, &k);
      cur += 1ll * x * k;
      add[x - 1] += k;
    } else if (tp == 2) {
      scanf("%d", &x);
      cur += x;
      arr[sz++] = x;
    } else {
      sz--;
      cur -= 1ll * add[sz] + arr[sz];
      if (sz) add[sz - 1] += add[sz], add[sz] = 0;
    }
    double t = (double)cur / sz;
    printf("%f\n", t);
  }
  return 0;
}
