Bessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n operations. Each operation is one of the following:  Add the integer x_{i} to the first a_{i} elements of the sequence.  Append an integer k_{i} to the end of the sequence. (And hence the size of the sequence increases by 1)  Remove the last element of the sequence. So, the size of the sequence decreases by one. Note, that this operation can only be done if there are at least two elements in the sequence. 

After each operation, the cows would like to know the average of all the numbers in the sequence. Help them!


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 2·10^5) — the number of operations. The next n lines describe the operations. Each line will start with an integer t_{i} (1 ≤ t_{i} ≤ 3), denoting the type of the operation (see above). If t_{i} = 1, it will be followed by two integers a_{i}, x_{i} (|x_{i}| ≤ 10^3; 1 ≤ a_{i}). If t_{i} = 2, it will be followed by a single integer k_{i} (|k_{i}| ≤ 10^3). If t_{i} = 3, it will not be followed by anything.

It is guaranteed that all operations are correct (don't touch nonexistent elements) and that there will always be at least one element in the sequence.


-----Output-----

Output n lines each containing the average of the numbers in the sequence after the corresponding operation.

The answer will be considered correct if its absolute or relative error doesn't exceed 10^{ - 6}.


-----Examples-----
Input
5
2 1
3
2 3
2 1
3

Output
0.500000
0.000000
1.500000
1.333333
1.500000

Input
6
2 1
1 2 20
2 2
1 2 -3
3
3

Output
0.500000
20.500000
14.333333
12.333333
17.500000
17.000000



-----Note-----

In the second sample, the sequence becomes $\{0 \} \rightarrow \{0,1 \} \rightarrow \{20,21 \} \rightarrow \{20,21,2 \} \rightarrow \{17,18,2 \} \rightarrow \{17,18 \} \rightarrow \{17 \}$

Difficulty: MEDIUM_HARD

Solutions:
suma = 0.0
items = 0
puros = [0]
agreg = [0]
cant = 1
queries = []
n = int(input())
for i in range(n):
	q = list(map(int, input().split()))
	if q[0] == 1:
		suma += q[1] * q[2]
		agreg[q[1] - 1] += q[2]
	elif q[0] == 2:
		puros.append(q[1])
		agreg.append(0)
		suma += q[1]
		cant += 1
	else:
		cant -= 1
		agreg[-2] += agreg[-1]
		suma -= agreg.pop() + puros.pop()
	queries.append(suma / cant)
print('\n'.join(['{0:.6f}'.format(q) for q in queries]))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
from sys import stdin
input = stdin.readline
n = int(input())
val = [0] * (n + 1)
add = [0] * (n + 1)
ptr = 1
sum = 0
for i in range(n):
	l = [int(x) for x in input().split()]
	if l[0] == 1:
		(a, x) = l[1:]
		add[a - 1] += x
		sum += a * x
	elif l[0] == 2:
		k = l[1]
		val[ptr] = k
		sum += k
		ptr += 1
	else:
		ptr -= 1
		sum -= val[ptr]
		sum -= add[ptr]
		add[ptr - 1] += add[ptr]
		add[ptr] = 0
	print('%.6f' % (sum / ptr))
endtime = time.time()


from sys import stdin
input = stdin.readline
(n, sum, point) = (int(input()), 0, 1)
num = (n + 1) * [0]
f = (n + 1) * [0]
for i in range(n):
	k = list(map(int, input().split()))
	if k[0] == 1:
		f[k[1] - 1] += k[2]
		sum += k[2] * k[1]
	elif k[0] == 2:
		num[point] = k[1]
		sum += k[1]
		point += 1
	elif k[0] == 3:
		point -= 1
		sum -= num[point] + f[point]
		f[point - 1] += f[point]
		f[point] = 0
	print('%.6f' % (sum / point))