Find the substring which maximize for all string set