#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 6;
const long long M = 1e9 + 1;
long long A[N];
long long B[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  memset(A, 0, sizeof(A));
  B[0] = 0;
  long long cur_sz = 1;
  double cur_avg = 0;
  while (n--) {
    long long x;
    cin >> x;
    if (x == 1) {
      long long ai, xi;
      cin >> ai >> xi;
      A[ai - 1] += xi;
      cur_avg = (cur_avg + (ai * xi));
      cout << fixed << setprecision(8) << (double)(cur_avg / cur_sz) << "\n";
    }
    if (x == 2) {
      long long ki;
      cin >> ki;
      B[cur_sz] = ki;
      cur_sz++;
      cur_avg += ki;
      cout << fixed << setprecision(8) << (double)(cur_avg / cur_sz) << "\n";
    }
    if (x == 3) {
      if (cur_sz >= 2) A[cur_sz - 2] += A[cur_sz - 1];
      cur_sz--;
      cur_avg = (cur_avg - (A[cur_sz] + B[cur_sz]));
      A[cur_sz] = 0;
      cout << fixed << setprecision(8) << (double)(cur_avg / cur_sz) << "\n";
    }
  }
}
