#include <bits/stdc++.h>
int seq[200001 + 1];
int add[200001 + 1];
int main(void) {
  int n, t, i, l = 1, a, x, k;
  long long s = 0;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d %d", &a, &x);
      add[a - 1] += x;
      s += x * a;
    } else if (t == 2) {
      scanf("%d", &k);
      seq[l++] = k;
      s += k;
    } else {
      --l;
      s -= seq[l] + add[l];
      if (l > 0) add[l - 1] += add[l];
      add[l] = 0;
    }
    printf("%6f\n", (double)s / l);
  }
  exit(EXIT_SUCCESS);
}
