#include <bits/stdc++.h>
using namespace std;
template <typename T>
void afill(T *arr, int size, T val) {
  fill(arr, arr + size, val);
}
long long mod;
double eps = 1e-9;
int n, t, m, q, k;
int main() {
  ios_base::sync_with_stdio(0);
  vector<int> oper{0}, numbers{0};
  scanf("%d", &n);
  double sum = 0.F;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &q);
    if (q == 1) {
      int a, x;
      scanf("%d %d", &a, &x);
      oper[a - 1] += x;
      sum += (double)(x * a);
    } else if (q == 2) {
      scanf("%d", &k);
      sum += (double)k;
      numbers.push_back(k);
      oper.push_back(0);
    } else if (numbers.size() > 1) {
      sum = sum - numbers.back() - oper.back();
      oper[oper.size() - 2] += oper.back();
      oper.pop_back();
      numbers.pop_back();
    }
    printf("%.6lf\n", sum / (double)oper.size());
  }
  cin >> n;
}
