Izhevsk Training Camp

아직 제출이 없습니다시간 제한3초메모리 제한256 MB

문제

Izhevsk Training Camp is about to begin! This season nn teams numbered with consecutive integers from 11 to nn will take part in this event. Nine sophisticated contests will be offered to participating teams in eleven days period. Contest are numbered with consecutive integers from 11 to 99. Three of these contests will form the Udmurtia Head Super Cup (UHSC). The question is: what three contests to choose for UHSC?

Oleg is helping to hold the Izhevsk Training Camp. For any contest he knows in advance what place each of the nn teams will take in this contest. He wants to use his knowledge to select three contests in order to minimize the total boredom of UHSC.

The boredom of UHSC can be computed as number of pairs of teams {ii, jj} such that team ii won team jj in each of three UHSC contests.

You are to write a program that will help Oleg to find three contests aa, bb and cc for UHSC such that the total boredom of UHSC is minimum possible.

입력

The first line of input contains an integer nn --- the number of participating teams  (2n2162 \leq n \leq 2^{16}).

The ii-th of the following nine lines contains the ii-th contest description: nn unique positive integers from 11 to nn --- team numbers ordered from the first place to the last.

출력

The only line of output should contain three positive integers aa, bb and cc --- numbers of contests to choose for UHSC (1a,b,c91 \leq a, b, c \leq 9, ab,ac,bca \neq b, a \neq c, b \neq c).

If there are multiple correct answers --- output any of them.

힌트

For the sample test case the minimum possible value of boredom is 55.