406068: GYM102254 A Arnon-Degree of Separation
Description
The psychologist Arnon, in his researches in IME, developed the theory of the Arnon-Degree of Separation.
According to this theory, it's necessary at most $$$k$$$ friendship bonds to connect any two people in the world. But for his theory to impress people, especially his friends De Castro and Caio, he needs to discover $$$k$$$.
Since he is too busy going out with his girlfriend, he asks you to discover this value. He will give to you a sample test with $$$n$$$ people and $$$m$$$ friendship bonds and you have to answer the minimum integer $$$k$$$ such that the theory will be valid.
InputThe first line contains two integers, $$$n$$$ and $$$m$$$ ($$$2 \le n \le 2 \times 10^3, 0 \le m \le 2 \times 10^3$$$) — the number of people and the number of friendship bonds, respectively.
The next $$$m$$$ lines contains, each, two integers, $$$a$$$ and $$$b$$$ ($$$1 \le a, b \le n$$$, $$$a \neq b$$$) — indicating that $$$a$$$ and $$$b$$$ are friends.
OutputPrint "=]" (without quotes) followed by an integer indicating the value of $$$k$$$.
In case it's not possible to reach some of the $$$n$$$ people, you should print "=[" (without quotes), instead.
ExamplesInput5 4 1 2 2 3 3 4 4 5Output
=] 4Input
7 7 1 2 3 6 2 4 3 5 2 5 2 3 2 7Output
=] 3