#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
int n, sz = 1, t, a;
long long x, sum, k, added[N], inc[N];
void print() { cout << (double)sum / sz << endl; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cin >> n;
  while (n--) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      inc[a - 1] += x;
      sum += a * x;
    } else if (t == 2) {
      cin >> k;
      added[sz++] = k;
      sum += k;
    } else {
      inc[sz - 2] += inc[sz - 1];
      sum -= added[sz - 1] + inc[sz - 1];
      inc[sz - 1] = 0;
      --sz;
    }
    print();
  }
  return 0;
}
