Winnie-the-Pooh
Everyone knows what Winnie-the-Pooh loves most of all — honey, of course. This morning, the little bear wanted to enjoy some honey. In his cellar, there are N barrels of honey, neatly arranged on a shelf and numbered from 1 to N. Each barrel contains honey with a unique level of "sweetness." To avoid disappointment, Winnie wants to eat the honey in such a way that each subsequent barrel is at least as sweet as the previous one. Moreover, he always eats the honey in order, to avoid any mistakes. Your task is to determine the maximum number of barrels Winnie can eat while adhering to his rules.
Input
The first line contains a single integer N (1 ≤ N ≤ 10^6), representing the number of barrels in Winnie-the-Pooh's cellar. The second line contains N integers, each representing the sweetness of a barrel (all numbers do not exceed 10^9). Following this, there is an integer M (1 ≤ M ≤ 10^5), indicating the number of queries. Each of the next M lines contains three integers: the type of query, l, and r (1 ≤ l ≤ r ≤ N). For a query of type 1, you need to find the solution to the problem. A query of type 2 indicates that the sweetness of the barrel numbered l has changed and is now equal to r.
Output
For each query of type 1, output the maximum number of consecutive barrels within the interval [l; r], where the sweetness of each barrel, except the first, is not less than the sweetness of the previous one.