#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000 + 100;
int n, cnt, ccnt;
int Index;
double aver;
double sum;
int command;
double num[maxn];
double ssum[maxn];
double *it;
int main() {
  ios::sync_with_stdio(false);
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &command);
    if (command == 1) {
      scanf("%lf", &num[cnt]);
      sum += num[cnt];
      ++ccnt;
      aver = sum / ccnt;
      while (num[Index] < aver) {
        sum += num[Index++];
        ++ccnt;
        aver = sum / ccnt;
      }
      aver = sum / ccnt;
      sum -= num[cnt];
      ++cnt;
      --ccnt;
    } else {
      printf("%f\n", num[cnt - 1] - aver);
    }
  }
  return 0;
}
