#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int32_t main() {
  cout.precision(10);
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, a[N], change[N], sz = 1;
  memset(a, 0, sizeof(a)), memset(change, 0, sizeof(change));
  long long sum = 0;
  cin >> n;
  while (n--) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, y;
      cin >> y >> x;
      sum += x * y;
      change[y] += x;
    } else if (t == 2) {
      int k;
      cin >> k;
      a[sz + 1] = k;
      sz = sz + 1;
      sum += k;
    } else {
      int cng = change[sz] + a[sz];
      sum = sum - cng;
      change[sz - 1] += change[sz];
      change[sz] = 0, a[sz] = 0;
      sz = sz - 1;
    }
    cout << fixed << (sum * 1.0) / sz << '\n';
  }
  return 0;
}
