#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 10;
int n, a[N] = {1};
char b[N];
double c[N], sum;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int ai, x;
      scanf("%d%d", &ai, &x);
      b[ai] = 1;
      c[ai] += x;
      sum += ai * x;
    } else if (t == 2) {
      int x;
      scanf("%d", &x);
      a[++a[0]] = x;
      sum += x;
    } else {
      sum -= a[a[0]--];
      if (b[a[0] + 1] == 1) {
        sum -= c[a[0] + 1];
        c[a[0]] += c[a[0] + 1];
        c[a[0] + 1] = 0;
        b[a[0]] = 1;
        b[a[0] + 1] = 0;
      }
    }
    printf("%.7lf\n", sum / (double)a[0]);
  }
  return 0;
}
