We, iuian develop a virtual vertical line with infinite length are numbered starting from zero from left to right. At every integer point of the vertical line, there is a bulb. Initially all the bulbs are turned on.
You are given Q queries of two types:
1 n (after this query nth bulb will be turned off, and remains turned off until end)
2 n (print the difference between nth position and nearest turned on bulb's position. i.e. answer could be 0)
Input
Input starts with an integer Q. next Q line contains two integer t and n. ( 1<= Q,n <= 5000000, 1<= t <= 2 )
Output
Print answers to queries of the type 2 in order they appear in the input.