least([[C,P]],[[C,P]]). least([[C,P]|Pairs],[[C1,P1],[C,P]|L1]) :- least(Pairs,[[C1,P1]|L1]),P1