Team Rocket is back with N of their Pokemon to trouble Pikachu. The Team Rocket's Pokemon are numbered from 1 to N and the ith pokemon has health equal to ai
Pikachu has to battle multiple Pokemon simultaneously. In a single battle, Team Rocket will make Pikachu fight against all the Pokemon in the range [l,r]. Pikachu can defeat a Pokemon if his attack value is atleast the Pokemon's health. So, he wants to know the minimum attack he must have to defeat all Pokemon in the range.
However, this time, Team Rocket is stronger than ever. They have designed a technology to modify their Pokemon's health as either of two ways:
Note that, all health changes occur simultaneously.
There will be Q events. Each event will be either a battle, or some modification of Pokemon's health by Team Rocket.
For each battle, help Pikachu by finding the minimum attack value he must have to win against all Pokemon in the range.
Constraints:
Input format:
Output format: