Given A digraph with N points and M edges, for each point v, find A(v) to represent the largest numbered point that can be reached from point v.
The first row, two integers N, M
Then M lines, two integers u,v on each line, represent a directed edge from u to v
(1 <= N,M <= 5*104, 1 <= u,v <= N)
Output the largest point that each point can reach
5 3 4 3 1 5 2 3
5 3 3 4 5