#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
int a[200007];
int main() {
  int n;
  cin >> n;
  a[0] = 0;
  long long s = 0;
  int cnt = 1;
  for (int query = (0); query < (n); ++query) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int k, x;
      scanf("%d%d", &k, &x);
      a[k - 1] += x;
      s += k * x;
    }
    if (t == 2) {
      int k;
      scanf("%d", &k);
      a[cnt] = k;
      a[cnt - 1] = a[cnt - 1] - a[cnt];
      s += k;
      cnt++;
    }
    if (t == 3) {
      a[cnt - 2] += a[cnt - 1];
      s -= a[cnt - 1];
      cnt--;
    }
    printf("%.10f\n", 1.0 * s / cnt);
  }
  return 0;
}
