Win the Contest

In the technical college of Skilliversity, there’s a competition between several participants who are from different colleges across the country. The contest is very tough, and so there were several teams with the same score at the end.

The organizer decided to go for a lucky draw as the last round to decide the winner and the runner up.

He decided to make 90 small pieces of paper each of which contained distinct numbers between 11 to 100 inclusive.

All participants with tied scores select a piece of paper at random. The selection happens in order. The first participant selects a piece of paper, performs some calculations that we will describe below, reports the result of the calculation, and then replaces the paper. The second participant again selects the piece of paper, does similar calculations, and then replaces it and so on until all these participants with tied scores have selected the paper.

Now to describe the calculation.

Suppose a participant selects a piece of paper with a number N.
Let P be the product of all consecutive natural numbers from 1 to N inclusive. Let X be the sum of all the digits of P. Let Y be the total number of zeros in P. (The total, not just trailing zeros!)

The participant has to report the value X - Y.

The winner is the person with the maximum value of X - Y, while the runner up is the one with the least value of X - Y.

In case there are several participants with the same value, the participant who comes first in the evaluation process is the winner. Same goes for the runner up. That is, assume there are 12 participants who qualified for the lucky draw round. Also suppose participants 1, 2 and 3 all have the maximum value of X - Y, while participants 10, 11 and 12 have the least value of X - Y.

Then the winner is 1 (participant 1 is evaluated before 2 and 3), and the runner up is 10.

It is not an easy task for participants to evaluate their score easily.
So the organizer decided to take help from you because you are one of the best coders in the college.

Write a program to help decide the winner and runner up!

*Input *

The first line of Input will contain total number of participants T.

Then T lines will follow each, with a single integer value in each line denoting the value obtained in the lucky draw for the ith participant where i runs from 1 to T.


There will be two lines of output.

The first line of output will contain two space separated integers. The first integer is the index of the participant who won (the index as defined in the input above). The second integer is the value X - Y for the winner.

The next line of output will also contain two space separated integers. The first integer is the index of the participant who is the runner up. The second integer is the value of X - Y for the runner up.


2 <= T <= 100000

11 <= Ti <=100
Sample Input





Sample Output

3 289

1 200

Put the link of question…