apac longest common prefix