Problem: You are given a multiset S consisting of positive integers (initially empty). There are two kind of queries: 

  1. Add a positive integer to S, the newly added integer is not less than any number in it. 
  2. Find a subset s of the set S such that the value <image> is maximum possible. Here max(s) means maximum value of elements in s, <image> — the average value of numbers in s. Output this maximum possible value of <image>. 

Input

The first line contains a single integer Q (1 ≤ Q ≤ 5·105) — the number of queries.

Each of the next Q lines contains a description of query. For queries of type 1 two integers 1 and x are given, where x (1 ≤ x ≤ 109) is a number that you should add to S. It's guaranteed that x is not less than any number in S. For queries of type 2, a single integer 2 is given.

It's guaranteed that the first query has type 1, i. e. S is not empty when a query of type 2 comes.

Output

Output the answer for each query of the second type in the order these queries are given in input. Each number should be printed in separate line.

Your answer is considered correct, if each of your answers has absolute or relative error not greater than 10 - 6.

Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if <image>.

Examples

Input

6
1 3
2
1 4
2
1 8
2


Output

0.0000000000
0.5000000000
3.0000000000


Input

4
1 1
1 4
1 5
2


Output

2.0000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template <typename T>
inline bool isLeap(T y) {
  return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);
}
template <typename T>
inline T GCD(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T EGCD(T a, T b, T &x, T &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  T x1, y1;
  T d = EGCD(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
template <typename T>
inline T LCM(T x, T y) {
  T tp = GCD(x, y);
  if ((x / tp) * 1. * y > 9e18) return 9e18;
  return (x / tp) * y;
}
template <typename T>
inline T BigMod(T A, T B, T M = MOD) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % M;
    A = (A * A) % M;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T InvMod(T A, T M = MOD) {
  return BigMod(A, M - 2, M);
}
template <typename T>
void Compress(T *in, int n, int f = 0) {
  vector<T> vv;
  for (int i = f; i < n + f; i++) vv.push_back(in[i]);
  sort(vv.begin(), vv.end()), vv.erase(unique(vv.begin(), vv.end()), vv.end());
  for (int i = f; i < n + f; i++)
    in[i] = lower_bound(vv.begin(), vv.end(), in[i]) - vv.begin();
}
template <typename T>
T scani(T &n) {
  n = 0;
  bool negative = false;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = true;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = n * 10 + c - 48;
    c = getchar();
  }
  if (negative) n = ~(n - 1);
  return n;
}
template <typename T>
void write(T n, int type = true) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  if (!n) {
    putchar('0');
    if (type == 32)
      putchar(' ');
    else if (type)
      putchar('\n');
    return;
  }
  char buff[22];
  int len = 0;
  while (n) buff[len++] = n % 10 + 48, n /= 10;
  for (int i = len - 1; i >= 0; i--) putchar(buff[i]);
  if (type == 32)
    putchar(' ');
  else if (type)
    putchar('\n');
}
int scans(char *a) {
  int i = 0;
  char c = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a[i++] = c;
    c = getchar();
  }
  a[i] = 0;
  return i;
}
template <typename T>
inline T SqrDis(T x1, T y1, T x2, T y2) {
  return ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
}
template <typename T>
inline T Area2(T Ax, T Ay, T Bx, T By, T Cx, T Cy) {
  T ret = Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By);
  if (ret < 0) return ret = -ret;
  return ret;
}
const int N = 2000006;
const int M = 200005;
const unsigned long long hs = 3797;
const int base = 333;
long long in[N];
long long n, m, l = 1, r = 0, sum;
bool check() {
  double prv = in[r] - (in[r] + sum) * 1.0 / l;
  double cur = in[r] - (in[r] + sum + in[l]) * 1.0 / (l + 1);
  return in[r] - (in[r] + sum + in[l]) * l >= in[r] - (in[r] + sum) * (l + 1);
}
int main() {
  scani(n);
  while (n--) {
    int t;
    scani(t);
    if (t == 1) {
      long long x;
      scani(x);
      in[++r] = x;
    } else {
      while (l < r && check()) {
        sum += in[l];
        l++;
      }
      double cur = (in[r] + sum) * 1.0 / l;
      printf("%.13f\n", in[r] - cur);
    }
  }
  return 0;
}