Олимпиадный тренинг

Задача 38282. Team Jupiter


Every year in one of the corners of our universe the Intellectual Olympic Games are held. This year, the honor of hosting this large-scale event fell to the planet Jupiter. You have to select two teams for the Games from the available n candidates for the national team.

All candidates are schoolchildren, each candidate studies in a certain class. Like on Earth, Jupiter has 11 classes, numbered from 1 to 11. Two teams are selected for the Games based on the results of the qualifying competitions. There are five qualifying rounds for the competition. At the end of each round, each student can score from 0 to 300 points, the more the better.

The four best schoolchildren get into the first team according to the sum of points scored in all qualifying rounds. The top four in terms of total points from those who did not make it to the first team, and at the same time do not study in grade 11, get into the second team.

All rounds have already been held, and it turned out that any two candidates scored a different number of points in total. It remains only to write a program that, according to the available data on the candidates and the results of the rounds, will determine those eight who will defend the honor of Jupiter at the Intellectual Olympic Games and prove that Jupiter — super planet!

Input
The first line of the input contains a single number n — the number of candidates for the Jupiter team ( 8 ≤ n ≤ 500 ).

The next n lines contain information about the candidates. Each line contains 6 integers — the number of the class in which the next candidate is studying, and his results in the qualifying rounds.

The class number is a number from 1 to 11, and the result on each round — number from 0 to 300.

It is guaranteed that all participants have different total scores.

It is guaranteed that there are at least 8 candidates who are not in grade 11.

Imprint
Output two lines.

The first line must contain four space-separated integers — the numbers of the candidates who will get into Jupiter's first team. Candidates are numbered starting from one in the order they appear in the input. Numbers should be displayed in ascending order.

The second line should describe the second Jupiter command in a similar format.
 
Examples
# Input Output
1 10
9 50 271 287 282 42
10 230 241 137 14 240
10 276 109 300 197 300
8 205 292 194 232 74
10 294 291 299 300 255
9 195 275 265 134 9
11 204 259 96 263 83
7 141 223 85 84 26
11 286 294 289 221 261
10 277 52 117 272 262
3 4 5 9
1 2 6 10