#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const long long MOD = (long long)(1e9 + 7);
using namespace std;
const long long N = 2e5 + 5;
long long a[N], pre[N], offset[N], sum;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  ;
  long long len = 1;
  long long n;
  cin >> n;
  cout << fixed << setprecision(12);
  while (n--) {
    long long ch;
    cin >> ch;
    if (ch == 1) {
      long long x, r, l = 1;
      cin >> r >> x;
      offset[l] += x;
      offset[r + 1] -= x;
      sum += r * x;
      double summ = sum, lenn = len;
      cout << summ / len << '\n';
      continue;
    }
    if (ch == 2) {
      long long k;
      cin >> k;
      ++len;
      a[len] = k;
      sum += k;
      double summ = sum, lenn = len;
      cout << summ / lenn << '\n';
      continue;
    }
    if (ch == 3) {
      if (offset[len + 1] != 0) {
        a[len] -= offset[len + 1];
        offset[len] += offset[len + 1];
        offset[len + 1] = 0;
      }
      sum -= a[len];
      len--;
      double summ = sum, lenn = len;
      cout << summ / lenn << '\n';
      continue;
    }
  }
  return 0;
}
