#include <bits/stdc++.h>
using namespace std;
clock_t begtime = clock();
void solve() {
  long long int n, len = 1, cursum = 0;
  double avg = 0;
  cin >> n;
  vector<long long int> a, b(n, 0);
  a.push_back(0);
  for (long long int i = (0); i <= (n - 1); i++) {
    long long int x;
    cin >> x;
    if (x == 1) {
      long long int y, z;
      cin >> y >> z;
      avg = (avg * len + y * z) / len;
      b[y] += z;
    } else if (x == 2) {
      long long int y;
      cin >> y;
      a.push_back(y);
      avg = (avg * len + y) / (len + 1);
      len++;
    } else {
      avg = (avg * len - b[len] - a[a.size() - 1]) / (len - 1);
      b[len - 1] += b[len];
      b[len] = 0;
      a.pop_back();
      len--;
    }
    cout << fixed;
    cout << setprecision(6) << avg << "\n";
  }
}
int main() {
  solve();
  return 0;
}
