#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, pre[300000];
  cin >> n;
  memset(pre, 0, 300000);
  long long int sum = 0;
  long long int c = 1;
  long long int pos = -1, ty;
  vector<long long int> v(300000);
  v[1] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ty;
    if (ty == 1) {
      long long int a;
      double x;
      cin >> a >> x;
      sum += a * x;
      pre[a] += x;
      pos = max(pos, a);
      cout << setprecision(15) << (long double)sum / (long double)c << endl;
    } else if (ty == 2) {
      long long int val;
      cin >> val;
      sum += val;
      v[c + 1] = val;
      c++;
      cout << setprecision(15) << (long double)sum / (long double)c << endl;
    } else {
      sum -= (v[c] + pre[c]);
      c--;
      if (pos > c) {
        pos--;
        pre[pos] += pre[pos + 1];
        pre[pos + 1] = 0;
      }
      cout << setprecision(15) << (long double)sum / (long double)c << endl;
    }
  }
}
