#include <bits/stdc++.h>
const long long inf = 1e17 + 7;
using namespace std;
const long long N = 1e6 + 1;
long long a[N], delta[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n;
  cin >> n;
  long long b, ind = 0, pos;
  double temp, sum = 0;
  memset(a, 0, sizeof(a));
  memset(delta, 0, sizeof(delta));
  cout << fixed << setprecision(6);
  for (long long i = 0; i < n; i++) {
    cin >> b;
    if (b == 1) {
      cin >> pos >> temp;
      delta[pos - 1] += temp;
      sum += pos * temp;
      cout << (double)(sum / (ind + 1)) << "\n";
    } else if (b == 2) {
      cin >> temp;
      a[++ind] = temp;
      sum += temp;
      cout << sum / (double)(ind + 1) << "\n";
    } else {
      delta[ind - 1] += delta[ind];
      sum -= (a[ind] + delta[ind]);
      delta[ind] = 0;
      ind--;
      cout << sum / (double)(ind + 1) << "\n";
    }
  }
  return 0;
}
