#include <bits/stdc++.h>
using namespace std;
long long int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  double sum = 0;
  v.push_back({0, 0});
  while (n--) {
    int type;
    cin >> type;
    if (type == 1) {
      int x, pos;
      cin >> pos >> x;
      pos = min(pos, int(v.size()));
      sum = sum + (pos * x);
      v[pos - 1].second += x;
    } else if (type == 2) {
      int k;
      cin >> k;
      v.push_back({k, 0});
      sum += k;
    } else {
      int pos = v.size() - 1;
      sum = sum - (v[pos].first + v[pos].second);
      if (pos > 1) v[pos - 1].second += v[pos].second;
      v.pop_back();
    }
    cout << fixed << setprecision(8);
    ;
    double s = v.size();
    double avg = sum / s;
    cout << avg << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  ;
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
