solver for crossing problem by hyuki