The first line has two numbers: N, M.
Next there are M rows of two integers: Ai, Bi.
10 3 5 4 7 9 0 2
13