#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int i, j, n, d = 1, a, b, c, t[200000] = {0};
long long sum = 0;
double ans[200000];
int main() {
  scanf("%d", &n);
  v.push_back(0);
  for (i = 0; i < n; i++) {
    scanf("%d", &c);
    if (c == 1) {
      scanf("%d%d", &a, &b);
      t[a - 1] += b;
      sum += a * b;
      ans[i] = (double)sum / d;
    } else if (c == 2) {
      scanf("%d", &a);
      v.push_back(a);
      sum += a;
      d++;
      ans[i] = (double)sum / d;
    } else {
      d--;
      sum -= v[d] + t[d];
      t[d - 1] += t[d];
      t[d] = 0;
      v.pop_back();
      ans[i] = (double)sum / d;
    }
  }
  for (i = 0; i < n; i++) printf("%lf\n", ans[i]);
  return 0;
}
