#include <bits/stdc++.h>
using namespace std;
long long a[500050], sum[500050];
int i = 0, Q, opt;
double F(int n) { return (double)a[i] - (sum[n] + a[i]) / (double)(n + 1); }
int main() {
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%lld", &a[++i]);
      sum[i] = sum[i - 1] + a[i];
    }
    if (opt == 2) {
      double maxf = 0.0;
      int l = 1, r = i - 1, lmid, rmid;
      while (l + 2 < r) {
        lmid = l + (r - l) / 3;
        rmid = r - (r - l) / 3;
        if (F(lmid) > F(rmid))
          r = rmid;
        else if (F(lmid) < F(rmid))
          l = lmid;
        else
          l = lmid, r = rmid;
      }
      for (int j = l; j <= r; j++) maxf = max(maxf, F(j));
      printf("%.10lf\n", maxf);
    }
  }
  return 0;
}
