Your software can answer queries about X. So you use all values of X and rank them. Repeat enough times and you make magic.