#include <bits/stdc++.h>
struct node {
  int l, r;
  long long sum;
  long long shu;
} tree[200005 * 4];
void Init(int l, int r, int idd) {
  tree[idd].l = l;
  tree[idd].r = r;
  tree[idd].sum = tree[idd].shu = 0;
  if (r - l <= 1) {
    return;
  }
  int mid = (l + r) / 2;
  Init(l, mid, idd * 2);
  Init(mid, r, idd * 2 + 1);
}
void down(int idd) {
  if (tree[idd].shu == 0) return;
  tree[idd * 2].sum += tree[idd].shu * (tree[idd * 2].r - tree[idd * 2].l);
  tree[idd * 2 + 1].sum +=
      tree[idd].shu * (tree[idd * 2 + 1].r - tree[idd * 2 + 1].l);
  tree[idd * 2].shu += tree[idd].shu;
  tree[idd * 2 + 1].shu += tree[idd].shu;
  tree[idd].shu = 0;
}
void up(int idd) { tree[idd].sum = tree[idd * 2 + 1].sum + tree[idd * 2].sum; }
void Update(int l, int r, int idd, int key) {
  if (tree[idd].l == l && tree[idd].r == r) {
    tree[idd].sum += key * (tree[idd].r - tree[idd].l);
    tree[idd].shu += key;
    return;
  }
  down(idd);
  int mid = (tree[idd].r + tree[idd].l) / 2;
  if (mid <= l)
    Update(l, r, idd * 2 + 1, key);
  else if (mid >= r)
    Update(l, r, idd * 2, key);
  else {
    Update(l, mid, idd * 2, key);
    Update(mid, r, idd * 2 + 1, key);
  }
  up(idd);
}
long long f;
void Qurry(int l, int r, int idd) {
  if (tree[idd].l == l && tree[idd].r == r) {
    f += tree[idd].sum;
    return;
  }
  down(idd);
  int mid = (tree[idd].r + tree[idd].l) / 2;
  if (mid <= l)
    Qurry(l, r, idd * 2 + 1);
  else if (mid >= r)
    Qurry(l, r, idd * 2);
  else {
    Qurry(l, mid, idd * 2);
    Qurry(mid, r, idd * 2 + 1);
  }
  up(idd);
}
int main() {
  int i, j, a, b, n, c, d;
  scanf("%d", &n);
  Init(1, n + 2, 1);
  d = 1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    if (a == 1) {
      scanf("%d%d", &b, &c);
      Update(1, b + 1, 1, c);
    } else if (a == 2) {
      scanf("%d", &b);
      d++;
      Update(d, d + 1, 1, b);
    } else {
      f = 0;
      Qurry(d, d + 1, 1);
      Update(d, d + 1, 1, -f);
      d--;
    }
    f = 0;
    Qurry(1, d + 1, 1);
    printf("%.6f\n", 1.0 * f / d);
  }
}
