Write a function to implement a basic K-means clustering algorithm from scratch.
Given multidimensional points, a cluster count, an iteration limit, and deterministic initial centroids, repeatedly assign each point to its nearest centroid and recompute cluster means. Use squared Euclidean distance and choose the lowest-index centroid when distances tie. If a cluster becomes empty, retain its previous centroid. Return the final centroids and each point's final cluster label.
points, initial_centroids, and centroids are lists of equal-length numeric lists. Return {"centroids": [...], "labels": [...]}. Labels must correspond to the returned centroids.
def k_means(points, k, max_iterations, initial_centroids):