#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> K(1, 0);
  vector<long long> A;
  long long sum = 0;
  for (size_t i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      int a, x;
      cin >> a >> x;
      if (A.size() < a) A.resize(a);
      A[a - 1] += x;
      sum += 1LL * x * a;
    } else if (t == 2) {
      int k;
      cin >> k;
      K.push_back(k);
      sum += k;
    } else if (t == 3) {
      size_t k = K.size();
      if (k >= 2) {
        if (A.size() >= k) {
          A[k - 2] += A[k - 1];
          sum -= A[k - 1];
          A[k - 1] = 0;
        }
        sum -= K.back();
        K.pop_back();
      }
    }
    printf("%0.6f\n", double(sum) / K.size());
  }
  return 0;
}
