#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int q;
  cin >> q;
  vector<long long> v, sum;
  while (q--) {
    int x;
    cin >> x;
    if (x == 1) {
      long long y;
      cin >> y;
      v.push_back(y);
      if (!sum.size())
        sum.push_back(y);
      else
        sum.push_back(sum.back() + y);
    } else {
      if (v.size() == 1) {
        cout << 0 << endl;
      } else {
        long long l = 0, r = v.size() - 2;
        while (r - l > 3) {
          long long m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
          long long m1Val = (m1 + 1) * v.back() - sum[m1];
          long long m2Val = (m2 + 1) * v.back() - sum[m2];
          if ((double)(m2 + 2) * m1Val < (double)(m1 + 2) * m2Val) {
            l = m1;
          } else {
            r = m2;
          }
        }
        double ans = 0;
        for (int i = l; i <= r; i++) {
          ans = max(ans, (double)(i + 1) * v.back() / (i + 2) -
                             (double)sum[i] / (i + 2));
        }
        cout << setprecision(12) << ans << endl;
      }
    }
  }
  return 0;
}
