#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, op, y;
double sum, x;
vector<double> seq, seq2;
int main() {
  scanf("%d", &n);
  seq.push_back(0);
  seq2.push_back(0);
  for (i = 1; i <= n; i++) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%lf", &y, &x);
      seq2[y - 1] += x;
      sum += y * x;
    }
    if (op == 2) {
      scanf("%lf", &x);
      seq.push_back(x);
      seq2.push_back(0);
      sum += x;
    }
    if (op == 3) {
      if (seq.size() != 1) seq2[seq.size() - 2] += seq2[seq.size() - 1];
      sum -= seq[seq.size() - 1];
      sum -= seq2[seq.size() - 1];
      seq.pop_back();
      seq2.pop_back();
    }
    printf("%.200000f\n", sum / ((double)seq.size()));
  }
  return 0;
}
