POJ#1838 sort, find and union. Rank:9006