Find longest common prefix.