Grandpa's Lottery Games

No attempts yetTime limit1sMemory limit1024 MB

Problem

Juku's grandpa is an enthusiastic and, in his own opinion, successful lottery player. Juku has doubts about that last claim, so for a while now he has been recording how much grandpa spends on lottery tickets and how much he wins.

Write a program that produces three kinds of statistics about grandpa's lottery games:

  • determine whether his total winnings are greater than or less than what he spent on tickets;
  • find on which day he lost the most money in a single day;
  • find during which run of consecutive days he lost the most money in total.

Input

The first line contains the number of Juku's diary entries $N$ ($1 \le N \le 100$). Each of the next $N$ lines contains two space-separated integers: on day $i$ ($1 \le i \le N$), the amount spent on tickets $P_i$ ($0 \le P_i \le 100$) and the amount won $V_i$ ($0 \le V_i \le 1,000,000$).

Output

Print exactly three lines, one answer per line.

On the first line print PLUSSIS, MIINUSES, or NULLIS depending on whether grandpa's total winnings are greater than, less than, or equal to his total ticket costs.

On the second line print two space-separated integers $P$ and $S$, where $P$ is the number of the day on which grandpa lost the most money in a single day and $S$ is that day's loss (ticket cost minus winnings, i.e. $P_i - V_i$). You may assume grandpa lost money on at least one day. If several days share the maximum single-day loss, print the one with the smallest (earliest) day number.

On the third line print three space-separated integers $P_1$, $P_2$, and $S$, meaning that grandpa's most costly period ran from day $P_1$ to day $P_2$, during which his ticket spending exceeded his winnings by a total of $S$. If several periods share the maximum total loss, print the one with the smallest starting day $P_1$, and among those the one with the smallest ending day $P_2$.