#include <bits/stdc++.h>
using namespace std;
long long int prefix[200101];
long long int arr[200101];
int main() {
  int N;
  cin >> N;
  int indx = 0;
  long long int sum = 0, subtract = 0;
  for (int i = 0; i < N; i++) {
    long long int t;
    scanf("%lld", &t);
    if (t == 1) {
      long long int a, x;
      scanf("%lld%lld", &a, &x);
      prefix[a - 1] += x;
      sum += a * x;
    } else if (t == 2) {
      long long int val;
      scanf("%lld", &val);
      indx++;
      arr[indx] += val;
      sum += val;
    } else {
      prefix[indx - 1] += prefix[indx];
      sum -= arr[indx];
      sum -= prefix[indx];
      arr[indx] = 0;
      prefix[indx] = 0;
      indx--;
    }
    printf("%.9f\n", sum * 1.0 / (indx + 1));
  }
  return 0;
}
