Network adiabatic theorem: an efficient randomized protocol for contention resolution