A method for grouping prosthetic valve leaflets of an aggregate of prosthetic valve leaflets is provided. Using a computer processor, for each leaflet of the aggregate, a leaflet-flexibility value is derived. A group size value is provided to the processor. Using the processor, at least some of the leaflets of the aggregate are designated into leaflet groups, based on similarity between the respective leaflet-flexibility value of each leaflet of the aggregate. Each of the leaflet groups includes a number of leaflets equal to the group size value. Using the processor, an indication of the designated leaflet groups is outputted. Other embodiments are also described.