A new technological breakthrough has enabled us to build bridges that can withstand a 9.5 magnitude earthquake for a fraction of the cost. Instead of retrofitting existing bridges which would take decades and cost at least 3x the price we're drafting up a proposal rebuild all of the bay area's bridges more efficiently between strategic coordinates outlined below.
You want to build the bridges as efficiently as possible and connect as many pairs of points as possible with bridges such that no two bridges cross. When connecting points, you can only connect point 1 with another point 1, point 2 with another point 2.
At example given on the map we should connect all the points except points with number 4.
Your program should accept as its first argument a path to a filename. Input example is the following
Each input line represents a pair of coordinates for each possible bridge.
You should output bridges in ascending order.
(Check lines on the map)