#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ln, lk, lm;
long long T[1 << 19];
int M;
void update(int l, int r, long long x) {
  l = l + M - 1;
  r = r + M + 1;
  for (; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) T[l ^ 1] += x;
    if (r & 1) T[r ^ 1] += x;
  }
}
int query(int l) {
  int ans = 0;
  l = l + M;
  while (l >= 1) {
    ans += T[l];
    l >>= 1;
  }
  return ans;
}
int tar = 1, t, a, x;
int main() {
  scanf("%d", &n);
  for (M = 1; n + 2 > M; M <<= 1)
    ;
  long long sum = 0;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", &a, &x);
      update(1, a, x);
      sum += a * x;
    } else if (t == 2) {
      scanf("%d", &x);
      tar++;
      update(tar, tar, x);
      sum += x;
    } else {
      long long v = query(tar);
      sum -= v;
      update(tar, tar, -v);
      tar--;
    }
    printf("%.10lf\n", 1.0 * sum / tar);
  }
  return 0;
}
