City set to buy hotels for homeless