Implement agglomerative hierarchical clustering with single, complete, and average linkage and deterministic cluster labels.