#include <bits/stdc++.h>
using namespace std;
int delta[310000];
int orig[310000];
int main() {
  long double sum = 0;
  long double ans;
  int num = 1;
  int n;
  scanf("%d", &n);
  int cmd, a, x;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &cmd);
    if (cmd == 1) {
      scanf("%d", &a);
      scanf("%d", &x);
      if (a > num) a = num;
      delta[a - 1] += x;
      sum += a * x;
    }
    if (cmd == 2) {
      scanf("%d", &x);
      delta[num] = 0;
      orig[num] = x;
      sum += x;
      ++num;
    }
    if (cmd == 3) {
      --num;
      delta[num - 1] += delta[num];
      orig[num] += delta[num];
      sum -= orig[num];
    }
    ans = (long double)num;
    ans = sum / ans;
    double da = (double)ans;
    cout << fixed << setprecision(10) << da;
    cout << "\n";
  }
  return 0;
}
