Range Minimum Query#3615

Range Minimum Query

2 seconds
128 megabytes
Very easy

The Giggle company opens their office in Elmsford and you are invited to interview. Your task is to solve the given problem.

You need to create a data structure that stores an array of integers. Initially, the array is empty. You need to support two operations:

Of course, this structure should be good enough.

Input

The first line contains the number of operations (1 \leq n \leq 200000) on array. Next lines describe the operations. All update operations are correct. All numbers stored in the array do not exceed 10^9 in absolute value.

Output

For each operation ? print on a separate line its result.

Examples

Example 1

Loading
Loading