Implement a function to perform k-means clustering from scratch.
Use squared Euclidean distance, assign ties to the lowest-indexed centroid, and stop when assignments stabilize or max_iters is reached. Empty clusters must retain their previous centroid.
Signature: def k_means(points, k, max_iters, initial_centroids):. Return (assignments, centroids), where assignments is a list of cluster indices and centroids is a list of coordinate lists.
def k_means(points, k, max_iters, initial_centroids):