#include <bits/stdc++.h>
using namespace std;
using namespace std;
const long double PI = acos(-1.0);
long long diff[200010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  int T, j, t, i, buckN = 1;
  int N = 1;
  scanf("%d", &T);
  long long sum = 0, a, x, lE = 0;
  while (T--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%lld%lld", &a, &x);
      sum += a * x;
      diff[a] -= x;
      if (a == N) {
        diff[a] += x;
        lE += x;
      }
    } else if (t == 2) {
      scanf("%lld", &a);
      diff[N] = a - lE;
      lE = a;
      N++;
      sum += a;
    } else {
      sum -= lE;
      --N;
      lE -= diff[N];
      diff[N] = 0;
    }
    printf("%.10f\n", (1.0 * sum) / N);
  }
  return 0;
}
