#include <bits/stdc++.h>
long long st[200100];
long long add[200100];
int main() {
  int i, j;
  int n;
  int type;
  long long sum;
  int a, x, k;
  int top;
  while (scanf("%d", &n) != EOF) {
    top = 0;
    st[top++] = 0;
    memset(add, 0, sizeof(add));
    sum = 0;
    while (n--) {
      scanf("%d", &type);
      if (type == 1) {
        scanf("%d %d", &a, &x);
        add[a] += x;
        sum += a * x;
      } else if (type == 2) {
        scanf("%d", &k);
        sum += k;
        st[top++] = k;
      } else {
        sum -= add[top];
        add[top - 1] += add[top];
        add[top] = 0;
        sum -= st[--top];
      }
      printf("%lf\n", (double)sum / (double)top);
    }
  }
  return 0;
}
