#include <bits/stdc++.h>
using namespace std;
class Solution {
  int n;
  int ma = -1e9;
  double avg = 0;
  priority_queue<int, vector<int>, greater<int>> unchosed;
  int num = 0;

 public:
  void run(istream &in, ostream &out) {
    in >> n;
    --n;
    in >> ma;
    in >> ma;
    avg = ma;
    num = 1;
    while (n--) {
      int type, a;
      in >> type;
      if (type == 1) {
        in >> a;
        if (a > ma) {
          avg = (avg * num - ma + a) / num;
          unchosed.push(ma);
          ma = a;
        } else
          unchosed.push(a);
        while (unchosed.size() and avg > unchosed.top()) {
          int v = unchosed.top();
          unchosed.pop();
          avg = (avg * num + v) / (num + 1);
          ++num;
        }
      } else
        out << fixed << setprecision(10) << ma - avg << '\n';
    }
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  Solution().run(cin, cout);
}
