#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p = 0, type, sum = 0, ai, xi, ki, i;
  vector<long long> seq, check;
  seq.push_back(0);
  check.push_back(0);
  cin >> n;
  while (n--) {
    cin >> type;
    if (type == 1) {
      cin >> ai >> xi;
      check[ai - 1] += xi;
      sum += ai * xi;
    } else if (type == 2) {
      cin >> ki;
      seq.push_back(ki);
      check.push_back(0);
      sum += ki;
      p++;
    } else {
      if (p > 0) {
        check[p - 1] += check[p];
        sum -= seq[p] + check[p];
        p--;
        seq.erase(seq.end() - 1);
        check.erase(check.end() - 1);
      }
    }
    long double avg;
    avg = ((long double)sum / (long double)(p + 1));
    cout << fixed << setprecision(8) << avg << endl;
  }
  return 0;
}
