function liste(icol)
	for stack=1, 16 do
		data=turtle.getItemDetail(stack)
		if data.damage==icol then
			turtle.select(stack)
			turtle.dropDown(1)
			turtle.drop(1)
			turtle.dropUp(1)
			return
		end
	end
end
while true do
	while redstone.getAnalogInput("left")<15 do
		for icol=0,15 do 
			liste(icol)	
		end
	end
	os.sleep(60)
end