Grouping Contours by Iterated Pairing Network