Python script reads file with information on gears, finds set of gears which satisfy arbitrary constraints.