#include <bits/stdc++.h>
using namespace std;
struct node {
 public:
  long long val, nodes, update;
  node() {
    val = 0;
    nodes = 0;
    update = 0;
  }
};
vector<node> t(1000016);
int n;
long long code;
node RMQ(int index, int L, int R, int i, int j) {
  if (t[index].update != 0) {
    if (2 * index < int((t).size())) {
      t[2 * index].update += t[index].update;
      t[2 * index + 1].update += t[index].update;
      t[index].val += (t[index].update * t[index].nodes);
    }
    t[index].update = 0;
  }
  if (L >= i && R <= j) {
    return t[index];
  }
  int mid = (L + R) / 2;
  if (j <= mid)
    return RMQ(2 * index, L, mid, i, j);
  else if (i > mid)
    return RMQ(2 * index + 1, mid + 1, R, i, j);
  else {
    node p1 = RMQ(2 * index, L, mid, i, j);
    node p2 = RMQ(2 * index + 1, mid + 1, R, i, j);
    node ret;
    ret.val = p1.val + p2.val;
    ret.nodes = p1.nodes + p2.nodes;
    return ret;
  }
}
void update(int pos, int l, int r, long long value, int L, int R) {
  int mid = (L + R) / 2;
  if (L > r || R < l) return;
  if (L == R) {
    t[pos].val += value;
    if (code == 3)
      t[pos].nodes = 0;
    else
      t[pos].nodes = 1;
    return;
  }
  if (L >= l && R <= r) {
    t[pos].update += value;
    return;
  }
  update(2 * pos + 1, l, r, value, mid + 1, R);
  update(2 * pos, l, r, value, L, mid);
  int i = 2 * pos;
  t[pos].val = t[i].val + t[i + 1].val;
  t[pos].nodes = t[i].nodes + t[i + 1].nodes;
}
int main() {
  scanf("%d", &n);
  n += 2;
  long long start = 1;
  code = 1;
  update(1, 0, 0, 0, 0, n - 1);
  long long sum = 0;
  for (int(i) = (0); (i) < (n - 2); (i)++) {
    scanf("%I64d", &code);
    if (code == 1) {
      long long num, val;
      scanf("%I64d%I64d", &num, &val);
      update(1, 0, num - 1, val, 0, n - 1);
      sum += (num * val);
    } else if (code == 2) {
      long long num;
      scanf("%I64d", &num);
      update(1, start, start, num, 0, n - 1);
      start++;
      sum += num;
    } else {
      if (start > 1) {
        long long x = RMQ(1, 0, n - 1, start - 1, start - 1).val;
        update(1, start - 1, start - 1, -x, 0, n - 1);
        start--;
        sum -= x;
      }
    }
    printf("%.10lf\n", (double)((long double)sum / start));
  }
}
