#include <bits/stdc++.h>
using namespace std;
int main() {
  int *arr = (int *)malloc(sizeof(int) * 200005);
  int c[200005] = {0};
  int i, z, t, n, k, x;
  long long int sum = 0;
  scanf("%d", &n);
  arr[0] = 0;
  z = 1;
  int num = 1;
  for (i = 0; i < n; i++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d", &x);
      scanf("%d", &k);
      c[x - 1] += k;
      sum = sum + (long long int)x * k;
      if (x - 1 > num) {
        num = x - 1;
        z = num + 1;
      }
    } else if (t == 2) {
      scanf("%d", &k);
      arr[z] = k;
      z++;
      sum = (long long int)sum + k;
      num += 1;
    } else if (t == 3) {
      z--;
      sum -= arr[z];
      if (c[z] != 0) {
        sum = (long long int)sum - c[z];
        if (z > 0) c[z - 1] += c[z];
        c[z] = 0;
      }
      num--;
    }
    printf("%0.6lf\n", (double)sum / num);
  }
  return 0;
}
