#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int *con = new int[200003];
  int *add = new int[200003];
  for (int i = 0; i < 200003; i++) {
    con[i] = 0;
    add[i] = 0;
  }
  double res = 0;
  int size = 1;
  int t, tmp1, tmp2;
  while (n--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", &tmp1, &tmp2);
      if (tmp1 > size) {
        tmp1 = size;
      }
      add[tmp1] += tmp2;
      res = res + (tmp1 * tmp2 * 1.0) / size;
    } else if (t == 2) {
      scanf("%d", &tmp1);
      ++size;
      con[size] = tmp1;
      res = (res * (size - 1) + tmp1) * 1.0 / size;
    } else if (size > 1) {
      res = (res * size - (con[size] + add[size])) / (size - 1);
      add[size - 1] += add[size];
      add[size] = 0;
      con[size] = 0;
      --size;
    }
    printf("%.6lf\n", res);
  }
  return 0;
}
