longest pair nonoverlapping substring with suffix automaton