#include <bits/stdc++.h>
using namespace std;
int main() {
  int niz[500000];
  int Q, a, b;
  scanf("%d", &Q);
  scanf("%d %d", &a, &b);
  int i, j;
  i = 0;
  j = 0;
  niz[0] = b;
  long long sum = 0;
  sum += niz[i];
  sum += niz[j];
  for (int it = 1; it < Q; it++) {
    scanf("%d", &a);
    if (a == 2) {
      printf("%lf\n", (niz[j] - sum / (double)(i + 1 + 1)));
    } else {
      scanf("%d", &b);
      j++;
      niz[j] = b;
      sum = sum - niz[j - 1] + niz[j];
      while (niz[i + 1] < sum / (double)(i + 1 + 1) && i + 1 < j) {
        sum += niz[i + 1];
        i++;
      }
    }
  }
  return 0;
}
