use largest common prefix