#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long min(long long x, long long y) {
  if (x > y)
    return y;
  else
    return x;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, j, k, q, m, n, qu;
  float f;
  cin >> qu;
  vector<long long> a, b(2 * 100000 + 1, 0);
  a.push_back(0);
  n = a.size();
  m = 0;
  while (qu) {
    cin >> q;
    if (q == 1) {
      cin >> j >> k;
      b[j] += k;
      m += (j * k);
      f = (float)m;
      f /= ((float)n);
      cout << fixed;
      cout << setprecision(6) << f << "\n";
    } else if (q == 2) {
      cin >> j;
      a.push_back(j);
      m += j;
      n++;
      f = (float)m;
      f /= ((float)n);
      cout << fixed;
      cout << setprecision(6) << f << "\n";
    } else {
      b[n - 1] += b[n];
      m -= a[n - 1] + b[n];
      b[n] = 0;
      a.pop_back();
      n--;
      f = (float)m;
      f /= ((float)n);
      cout << fixed;
      cout << setprecision(6) << f << "\n";
    }
    qu--;
  }
  return 0;
}
