#include <bits/stdc++.h>
using namespace std;
const int maxl = 200500;
const int oo = 5005;
struct Ttree {
  long long sum, del;
} tree[4 * maxl];
int n, op, b, x, lb, rb, siz;
double ans;
void Update(int rt, int le, int ri) {
  if (tree[rt].del) {
    int mid = (le + ri) >> 1;
    tree[rt << 1].sum += tree[rt].del * (mid - le + 1);
    tree[rt << 1 | 1].sum += tree[rt].del * (ri - mid);
    tree[rt << 1].del += tree[rt].del;
    tree[rt << 1 | 1].del += tree[rt].del;
    tree[rt].del = 0;
  }
}
void Add(int rt, int le, int ri) {
  if ((le > rb) || (ri < lb)) return;
  if ((lb <= le) && (ri <= rb)) {
    if (x != -oo) {
      tree[rt].del += x;
      tree[rt].sum += (ri - le + 1) * x;
    } else
      tree[rt].del = tree[rt].sum = 0;
    return;
  }
  int mid = (le + ri) >> 1;
  Update(rt, le, ri);
  Add(rt << 1, le, mid);
  Add(rt << 1 | 1, mid + 1, ri);
  tree[rt].sum = tree[rt << 1].sum + tree[rt << 1 | 1].sum;
}
int main() {
  scanf("%d", &n);
  siz = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &b, &x);
      lb = 1;
      rb = b;
      Add(1, 1, maxl);
    } else if (op == 2) {
      scanf("%d", &x);
      lb = rb = ++siz;
      Add(1, 1, maxl);
    } else if (op == 3) {
      x = -oo;
      lb = rb = siz--;
      Add(1, 1, maxl);
    }
    ans = (double)tree[1].sum / siz;
    printf("%0.6lf\n", ans);
  }
  return 0;
}
