Adventures of Dunno and His Friends
We all remember the story how Dunno and his friends traveled in a balloon. But not everyone knows that not all the men climbed into a ball, because it had a limited capacity.
In this problem you need to know how many men departed to travel. It is known that the balloon boarding is not optimal: men go into the balloon in the same sequence as they stand in the line, when for some of them there is not enough space in the balloon, he and all the rest in the line turn around and go home.
Input
The first line contains the number of men in the flower city. The second line contains the weights of the men in the order of their boarding. All weights are positive integers not greater than . Then the number of queries is given. Each query is given in one line. The first number in a line is the query type.
If , then given one integer — the balloon load capacity.
If , then given two integers and — the weight of a person at position becomes .
Output
For each query with the number one print in a separate line the number of men that can be boarded the balloon.