eolymp
bolt
Try our new interface for solving problems

Irony

\textit{Stirlitz was driving, saw a voter Bormann, and drove on. Some time later he again saw the voting Bormann, and again drove past. Soon, he again saw the voter Bormann. - Fun! - Thought Bormann. - Ring! - Guessed Stirlitz.} In the city of N space. Any two squares are connected by exactly one-way roads. In this city lives Stirlitz. In Shtirlitsa have a hobby - he loves the Sunday morning leaving the house, get in the car, pick any circular route that passes exactly on the three areas (ie, first he goes to some space on some other, then - on the third , then returned to the home, and again going through this route). He imagines that somewhere along the way worth Bormann. And so here goes Stirlitz all on Sunday, while the head does not begin to spin, and rejoice ... Naturally, the Stirlitz want to go past the point at which he thinks is worth Borman, as often as possible. Then, of course, selected Stirlitz route should be as short as possible. Write a program that selects the optimal route for Shtirlitza. \InputFile The first line contains first the number \textbf{N} (\textbf{3} ≤ \textbf{N} ≤ \textbf{100}), and then \textbf{N}x\textbf{N} matrix of distances between the areas (the number in position \textbf{i}, \textbf{j} denotes the length of the road connecting the \textbf{i}-th and \textbf{j}-th area). All the numbers in the matrix (except on the main diagonal) - natural, not exceeding \textbf{1000}. The matrix is symmetric about the main diagonal, on the main diagonal are \textbf{0}. \OutputFile Display the number of areas in the optimal route. If several routes, display any of them.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5
0  20 10   30 40
20 0  30   1  2
10 30 0    40 1000
30 1  40   0  21
40 2  1000 21 0
Output example #1
4 5 2