Clustering Approach for Higher-Order Deterministic Masking