URI Online Judge | 1811

The Oscar Goes To...

By Unknown Brasil

Timelimit: 3

There is no moment of greatest anguish among the movie stars that the ceremony of delivery of the statues at the Kodak Theatre. Are not rare actors and actresses who see their pulse reaching alarming levels. The risk of a heart attack grows when the beats become more and faster in consecutive periods, suggesting a period of great anxiety.

Concerned about this fact, the Academy of Arts and Sciences in Hollywood decided to monitor the heartbeat, at regular intervals, of several candidates to receive the statuette. With these data they intend to make a program that alerts doctors on call if one of the famous is on the verge of a heart attack. Your task in this problem is to assist the Academy in this noble mission.

Input

Several instances are given. The first line of each instance contains the number 0 ≤ n ≤ 1000 of actors/actresses monitored (which will be identified by numbers 1, 2, ..., n) and the number 0 ≤ m ≤ 100 beats observed in these actors. Then, in each of the next n lines are given the measurement m (the heartbeat is an integer between 0 and 200). The case in which n = 0 represents the end of the file and it must not be processed.

Output

You will need to print a header indicating the number of the instance that you are handling (Instancia # i) and in the following line, the number of the actor / actress who is most at risk of suffering a heart attack. The risk for heart attack increases with the number of consecutive observations when the number of beats increased. If there is a tie on this criterion, return the actor who has the biggest difference between the first and last measurement interval, where the beats were increasing. If the tie persists, the risk will be higher for those with the highest rate at the end of the interval. If there is still no decision, return the lowest index.

A blank line must be printed after each output instance.

Sample Input Sample Output

4 10
67 78 87 66 78 87 89 66 67 66
77 79 99 98 98 98 97 78 78 89
66 67 68 69 70 71 72 87 88 66
75 77 90 95 94 97 99 66 88 99
4 7
120 135 167 165 188 170 150
98 76 60 78 108 100 110
90 95 138 135 133 130 100
70 68 74 67 75 67 100
0

Instancia #1
3


Instancia #2
3