A classification of toric varieties with few generators