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 JAVA):

Solution:
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;


import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.TreeSet;


public final class CF_464_E{

	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(double[] X){if (verb) {for (double U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}



	// Global vars
	static BufferedWriter out;
	static InputReader reader;

	static long powerMod(long b,long e,long m){
		long x=1;
		while (e>0) {
			if (e%2==1)
				x=(b*x)%m;
			b=(b*b)%m;
			e=e/2;
		}
		return x; 
	}

	static int sign(long x){
		if (x==0)
			return 0;
		if (x>0)
			return 1;
		return -1;
	}


	static int CX=26;

	static double mean(long a,int k,int x){
		double mn=a+x;
		mn/=k+1;
		return mn;
	}

	static double ternaryMax(int x,long[] ar,int left,int right){
		while (true) {
			//log(left+" "+right);
			//log(ar[left]+"@"+left+" // "+ar[right]+"@"+right);
			if (right-left<3){
				double best=x-mean(ar[left],left+1,x);
				int pos=left;
				for (int i=left+1;i<=right;i++){
					double v=x-mean(ar[i],i+1,x);
					if (v>best){
						best=v;
						pos=i;
					}
				}
				return best;
			}
			int mid1=left+(right-left)/3;
			int mid2=right-(right-left)/3;
			//log("mid1:"+ar[mid1]+"@"+mid1+" // "+"mid2:"+ar[mid2]+"@"+mid2);


			if (x-mean(ar[mid1],mid1+1,x)<x-mean(ar[mid2],mid2+1,x))
				left=mid1;
			else
				right=mid2;

		}

	}

	static void process() throws Exception {


		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader=new InputReader(System.in);

		int Q=reader.readInt();
		double[] m=new double [Q+1];
		int kmax=0;
		double best=-1;

		int[] stackk=new int[Q];
		double[] stackm=new double[Q];
		int st=1;
		int cnt=0;

		double sum=0;
		/*
		for (int q=0;q<Q;q++){
			int typ=reader.readInt();
			if (typ==1){
				double x=reader.readInt();
				sum+=x;
				cnt++;
				//log("x:"+x);
				int bst=0;
				double gmm=0;
				int gk=0;
				for (int u=st-1;u>=0;u--){
					int k=stackk[u];
					double med=stackm[u];
					double mm=(k*med+x)/(k+1);
					//log("mm:"+mm);
					double y=x-mm;
					//log(y);
					if (y>best){
						best=y;
						bst=u;
						gmm=mm;
						gk=k+1;
					}

				}
				//log("bst:"+bst);
				//st=bst+1;
				stackk[bst+1]=cnt;
				stackm[bst+1]=sum/cnt;
				st=bst+2;
				//log("st:"+st);
				//log(stackk);
				//log(stackm);
			} else {
				output(best);
			}

		}
		 */


		/*

		for (int q=0;q<Q;q++){
			int typ=reader.readInt();
			if (typ==1){
				double x=reader.readInt();
				for (int k=0;k<=kmax;k++){
					double mm=(k*m[k]+x)/(k+1);

					double y=x-mm;

					if (y>best)
						best=y;
					if (k==kmax){
						m[k+1]=mm;
					}
				}
				kmax++;
			} else {
				output(best);
			}
		}
		for (double x:m)
			log(x);

		 */

		long[] val=new long[Q];
		//long[] max=new long[Q];
		long cur=0;
		st=0;


		for (int q=0;q<Q;q++){
			int typ=reader.readInt();
			if (typ==1){
				int x=reader.readInt();
				cur+=x;
				//max[st]=x;
				val[st++]=cur;
				double v=ternaryMax(x,val,0,st-1);
				if (v>best)
					best=v;
				
			} else {


						output(best);
			}
		}



		/*
		long sum=0;
		int cnt=0;
		for (int q=0;q<Q;q++){
			int typ=reader.readInt();
			if (typ==1){
				cnt++;
				int x=reader.readInt();
				sum+=x;
				double db=sum;
				db/=cnt;
				double mm=x-db;
				if (mm>best)
					best=mm;
				log(mm);
			} else {
				output(best);
			}
		}
		 */
		try {
			out.close();
		}
		catch (Exception EX){}


	}


	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}


		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res=new StringBuilder();
			do {
				res.append((char)c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}




		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}


}