#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, k, x, d[200001] = {}, last_d = 1, last = 0, a;
  long long sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    if (1 == t) {
      cin >> a >> x;
      sum += a * x;
      if (last_d == 0) {
        last += x;
      } else if (last_d == a) {
        last += x;
      } else {
        d[a] -= x;
      }
    } else if (2 == t) {
      cin >> k;
      sum += k;
      d[last_d++] = k - last;
      last = k;
    } else {
      sum -= last;
      last -= d[--last_d];
    }
    cout << setiosflags(ios::fixed) << setprecision(6)
         << ((double)sum) / ((double)last_d) << endl;
  }
}
