poj2236. union-find-set. compare to graph(dfs). much faster